From e20301386a35a09efb252dd20638f7f236f03b4b Mon Sep 17 00:00:00 2001 From: Kostya Date: Mon, 20 Nov 2023 23:00:41 +0300 Subject: [PATCH] added timer for remove notification --- luckydiamond/src/components/AsidebarComponent.vue | 6 +++++- .../src/components/NotiicationwindowComponent.vue | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/luckydiamond/src/components/AsidebarComponent.vue b/luckydiamond/src/components/AsidebarComponent.vue index 7794291..a94e08c 100644 --- a/luckydiamond/src/components/AsidebarComponent.vue +++ b/luckydiamond/src/components/AsidebarComponent.vue @@ -17,7 +17,7 @@ - + @@ -33,10 +33,14 @@ export default { AnimationOff: false } }, + emits: ['animationchange'], methods: { ChangeAnimation() { this.AnimationOff = !this.AnimationOff return this.$emit('animationchange', this.AnimationOff) + }, + NotificationRemove(value) { + this.AnimationOff = value } } } diff --git a/luckydiamond/src/components/NotiicationwindowComponent.vue b/luckydiamond/src/components/NotiicationwindowComponent.vue index f37b756..84f7e48 100644 --- a/luckydiamond/src/components/NotiicationwindowComponent.vue +++ b/luckydiamond/src/components/NotiicationwindowComponent.vue @@ -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() + } + } } }