File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export const CAlert = defineComponent({
46
46
] ,
47
47
setup ( props , { slots, emit } ) {
48
48
const visible = ref ( props . visible )
49
- const dismiss = ( ) => {
49
+ const handleDismiss = ( ) => {
50
50
visible . value = false
51
51
emit ( 'dismiss' )
52
52
}
@@ -82,7 +82,7 @@ export const CAlert = defineComponent({
82
82
props . dismissible &&
83
83
h ( CCloseButton , {
84
84
onClick : ( ) => {
85
- dismiss ( )
85
+ handleDismiss ( )
86
86
} ,
87
87
} ) ,
88
88
] ,
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export const CCloseButton = defineComponent({
18
18
required : false ,
19
19
} ,
20
20
} ,
21
- setup ( props ) {
21
+ emits : [ 'click' ] ,
22
+ setup ( props , { emit } ) {
23
+ const handleClick = ( ) => {
24
+ emit ( 'click' )
25
+ }
22
26
return ( ) =>
23
27
h ( 'button' , {
24
28
class : [
@@ -31,6 +35,7 @@ export const CCloseButton = defineComponent({
31
35
] ,
32
36
'aria-label' : 'Close' ,
33
37
disabled : props . disabled ,
38
+ onClick : handleClick ,
34
39
} )
35
40
} ,
36
41
} )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const CToastClose = defineComponent({
14
14
} ,
15
15
...CCloseButton . props ,
16
16
} ,
17
+ emits : [ 'dismiss' ] ,
17
18
setup ( props , { slots, emit } ) {
18
19
const updateVisible = inject ( 'updateVisible' ) as any
19
20
const handleClose = ( ) => {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const CToastHeader = defineComponent({
7
7
/**
8
8
* Automatically add a close button to the header.
9
9
*/
10
- dismiss : {
10
+ close : {
11
11
type : Boolean ,
12
12
require : false ,
13
13
} ,
@@ -22,7 +22,7 @@ const CToastHeader = defineComponent({
22
22
return ( ) =>
23
23
h ( 'div' , { class : 'toast-header' } , [
24
24
slots . default && slots . default ( ) ,
25
- props . dismiss &&
25
+ props . close &&
26
26
h ( CToastClose , {
27
27
onClose : ( ) => handleClose ( ) ,
28
28
} ) ,
You can’t perform that action at this time.
0 commit comments