Skip to content

Commit 022a3ce

Browse files
committed
fix: notification style error, close #4703
1 parent a5a3411 commit 022a3ce

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

components/notification/demo/with-btn.vue

+10-9
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ export default defineComponent({
3737
message: 'Notification Title',
3838
description:
3939
'A function will be be called after the notification is closed (automatically after the "duration" time of manually).',
40-
btn: h(
41-
Button,
42-
{
43-
type: 'primary',
44-
size: 'small',
45-
onClick: () => notification.close(key),
46-
},
47-
'Confirm',
48-
),
40+
btn: () =>
41+
h(
42+
Button,
43+
{
44+
type: 'primary',
45+
size: 'small',
46+
onClick: () => notification.close(key),
47+
},
48+
{ default: () => 'Confirm' },
49+
),
4950
key,
5051
onClose: close,
5152
});

components/notification/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ function notice(args: NotificationArgsProps) {
172172
const duration = args.duration === undefined ? defaultDuration : args.duration;
173173
getNotificationInstance(args, notification => {
174174
notification.notice({
175-
content: ({ prefixCls }) => {
175+
content: ({ prefixCls: outerPrefixCls }) => {
176+
const prefixCls = `${outerPrefixCls}-notice`;
176177
let iconNode = null;
177178
if (icon) {
178179
iconNode = () => <span class={`${prefixCls}-icon`}>{renderHelper(icon)}</span>;

0 commit comments

Comments
 (0)