mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 04:09:29 +02:00
added timer for remove notification
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
<notiicationwindow-component :isAnimationOn = "AnimationOff"></notiicationwindow-component>
|
<notiicationwindow-component :isAnimationOn = "AnimationOff" @animationchange="NotificationRemove"></notiicationwindow-component>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
@@ -33,10 +33,14 @@ export default {
|
|||||||
AnimationOff: false
|
AnimationOff: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['animationchange'],
|
||||||
methods: {
|
methods: {
|
||||||
ChangeAnimation() {
|
ChangeAnimation() {
|
||||||
this.AnimationOff = !this.AnimationOff
|
this.AnimationOff = !this.AnimationOff
|
||||||
return this.$emit('animationchange', this.AnimationOff)
|
return this.$emit('animationchange', this.AnimationOff)
|
||||||
|
},
|
||||||
|
NotificationRemove(value) {
|
||||||
|
this.AnimationOff = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,21 @@ import '@/assets/css/ComponentsStyles/notification.css'
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
isAnimationOn: Boolean
|
isAnimationOn: Boolean
|
||||||
|
},
|
||||||
|
emits: ['animationchange'],
|
||||||
|
methods: {
|
||||||
|
NotificationsTimer() {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$emit('animationchange', false)
|
||||||
|
}, 4000)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
isAnimationOn(newVal, oldVal) {
|
||||||
|
if (newVal !== oldVal) {
|
||||||
|
this.NotificationsTimer()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user