We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b3ade8 commit 7ea18a8Copy full SHA for 7ea18a8
components/vc-notification/Notice.tsx
@@ -46,9 +46,10 @@ export default defineComponent<NoticeProps>({
46
] as any,
47
setup(props, { attrs, slots }) {
48
let closeTimer: any;
49
- const duration = computed(() => (props.duration === undefined ? 1.5 : props.duration));
+ let isUnMounted = false;
50
+ const duration = computed(() => (props.duration === undefined ? 4.5 : props.duration));
51
const startCloseTimer = () => {
- if (duration.value) {
52
+ if (duration.value && !isUnMounted) {
53
closeTimer = setTimeout(() => {
54
close();
55
}, duration.value * 1000);
@@ -79,6 +80,7 @@ export default defineComponent<NoticeProps>({
79
80
startCloseTimer();
81
});
82
onUnmounted(() => {
83
+ isUnMounted = true;
84
clearCloseTimer();
85
86
0 commit comments