File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
components/vc-notification Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,10 @@ export default defineComponent<NoticeProps>({
4646 ] as any ,
4747 setup ( props , { attrs, slots } ) {
4848 let closeTimer : any ;
49- const duration = computed ( ( ) => ( props . duration === undefined ? 1.5 : props . duration ) ) ;
49+ let isUnMounted = false ;
50+ const duration = computed ( ( ) => ( props . duration === undefined ? 4.5 : props . duration ) ) ;
5051 const startCloseTimer = ( ) => {
51- if ( duration . value ) {
52+ if ( duration . value && ! isUnMounted ) {
5253 closeTimer = setTimeout ( ( ) => {
5354 close ( ) ;
5455 } , duration . value * 1000 ) ;
@@ -79,6 +80,7 @@ export default defineComponent<NoticeProps>({
7980 startCloseTimer ( ) ;
8081 } ) ;
8182 onUnmounted ( ( ) => {
83+ isUnMounted = true ;
8284 clearCloseTimer ( ) ;
8385 } ) ;
8486
You can’t perform that action at this time.
0 commit comments