fix: notification style error, close #4703

pull/4738/head
tangjinzhou 2021-10-03 14:05:02 +08:00
parent a5a3411c28
commit 022a3ce795
2 changed files with 12 additions and 10 deletions

View File

@ -37,14 +37,15 @@ export default defineComponent({
message: 'Notification Title', message: 'Notification Title',
description: description:
'A function will be be called after the notification is closed (automatically after the "duration" time of manually).', 'A function will be be called after the notification is closed (automatically after the "duration" time of manually).',
btn: h( btn: () =>
h(
Button, Button,
{ {
type: 'primary', type: 'primary',
size: 'small', size: 'small',
onClick: () => notification.close(key), onClick: () => notification.close(key),
}, },
'Confirm', { default: () => 'Confirm' },
), ),
key, key,
onClose: close, onClose: close,

View File

@ -172,7 +172,8 @@ function notice(args: NotificationArgsProps) {
const duration = args.duration === undefined ? defaultDuration : args.duration; const duration = args.duration === undefined ? defaultDuration : args.duration;
getNotificationInstance(args, notification => { getNotificationInstance(args, notification => {
notification.notice({ notification.notice({
content: ({ prefixCls }) => { content: ({ prefixCls: outerPrefixCls }) => {
const prefixCls = `${outerPrefixCls}-notice`;
let iconNode = null; let iconNode = null;
if (icon) { if (icon) {
iconNode = () => <span class={`${prefixCls}-icon`}>{renderHelper(icon)}</span>; iconNode = () => <span class={`${prefixCls}-icon`}>{renderHelper(icon)}</span>;