added timer for remove notification

This commit is contained in:
Kostya
2023-11-20 23:00:41 +03:00
parent 4bb3f35e5b
commit e20301386a
2 changed files with 20 additions and 1 deletions

View File

@@ -14,6 +14,21 @@ import '@/assets/css/ComponentsStyles/notification.css'
export default {
props: {
isAnimationOn: Boolean
},
emits: ['animationchange'],
methods: {
NotificationsTimer() {
setTimeout(() => {
this.$emit('animationchange', false)
}, 4000)
}
},
watch: {
isAnimationOn(newVal, oldVal) {
if (newVal !== oldVal) {
this.NotificationsTimer()
}
}
}
}
</script>