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({
4646 ] ,
4747 setup ( props , { slots, emit } ) {
4848 const visible = ref ( props . visible )
49- const dismiss = ( ) => {
49+ const handleDismiss = ( ) => {
5050 visible . value = false
5151 emit ( 'dismiss' )
5252 }
@@ -82,7 +82,7 @@ export const CAlert = defineComponent({
8282 props . dismissible &&
8383 h ( CCloseButton , {
8484 onClick : ( ) => {
85- dismiss ( )
85+ handleDismiss ( )
8686 } ,
8787 } ) ,
8888 ] ,
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export const CCloseButton = defineComponent({
1818 required : false ,
1919 } ,
2020 } ,
21- setup ( props ) {
21+ emits : [ 'click' ] ,
22+ setup ( props , { emit } ) {
23+ const handleClick = ( ) => {
24+ emit ( 'click' )
25+ }
2226 return ( ) =>
2327 h ( 'button' , {
2428 class : [
@@ -31,6 +35,7 @@ export const CCloseButton = defineComponent({
3135 ] ,
3236 'aria-label' : 'Close' ,
3337 disabled : props . disabled ,
38+ onClick : handleClick ,
3439 } )
3540 } ,
3641} )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const CToastClose = defineComponent({
1414 } ,
1515 ...CCloseButton . props ,
1616 } ,
17+ emits : [ 'dismiss' ] ,
1718 setup ( props , { slots, emit } ) {
1819 const updateVisible = inject ( 'updateVisible' ) as any
1920 const handleClose = ( ) => {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const CToastHeader = defineComponent({
77 /**
88 * Automatically add a close button to the header.
99 */
10- dismiss : {
10+ close : {
1111 type : Boolean ,
1212 require : false ,
1313 } ,
@@ -22,7 +22,7 @@ const CToastHeader = defineComponent({
2222 return ( ) =>
2323 h ( 'div' , { class : 'toast-header' } , [
2424 slots . default && slots . default ( ) ,
25- props . dismiss &&
25+ props . close &&
2626 h ( CToastClose , {
2727 onClose : ( ) => handleClose ( ) ,
2828 } ) ,
You can’t perform that action at this time.
0 commit comments