Skip to content

Commit ddbf476

Browse files
committed
refactor(CToastHeader): improve syntax
1 parent 76cd392 commit ddbf476

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/components/toast/CToastHeader.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ const CToastHeader = defineComponent({
1212
require: false,
1313
},
1414
},
15+
emits: [
16+
/**
17+
* Event called after clicking the close button.
18+
*/
19+
'close',
20+
],
1521
setup(props, { slots, emit }) {
16-
const handleClose = () => {
17-
/**
18-
* Event called after clicking the close button.
19-
*/
20-
emit('close')
21-
}
2222
return () =>
2323
h('div', { class: 'toast-header' }, [
2424
slots.default && slots.default(),
2525
props.closeButton &&
2626
h(CToastClose, {
27-
onClose: () => handleClose(),
27+
onClose: () => emit('close'),
2828
}),
2929
])
3030
},

0 commit comments

Comments
 (0)