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>({
46
46
] as any ,
47
47
setup ( props , { attrs, slots } ) {
48
48
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 ) ) ;
50
51
const startCloseTimer = ( ) => {
51
- if ( duration . value ) {
52
+ if ( duration . value && ! isUnMounted ) {
52
53
closeTimer = setTimeout ( ( ) => {
53
54
close ( ) ;
54
55
} , duration . value * 1000 ) ;
@@ -79,6 +80,7 @@ export default defineComponent<NoticeProps>({
79
80
startCloseTimer ( ) ;
80
81
} ) ;
81
82
onUnmounted ( ( ) => {
83
+ isUnMounted = true ;
82
84
clearCloseTimer ( ) ;
83
85
} ) ;
84
86
You can’t perform that action at this time.
0 commit comments