added logic for notification

This commit is contained in:
Kostya
2023-12-20 17:29:02 +03:00
parent 33d40cc65a
commit 613ea20bb7
2 changed files with 18 additions and 12 deletions

View File

@@ -0,0 +1,36 @@
<template>
<div class="notification" v-if="notification">
<div class="notification__content">
<h3>Успешное пополнение</h3>
</div>
</div>
</template>
<script>
import '@/assets/css/ComponentsStyles/notification.css'
export default {
props: {
notification: Boolean
},
emits: ['notificationremove'],
methods: {
NotificationsTimer() {
setTimeout(() => {
this.$emit('notificationremove')
}, 4000)
}
},
watch: {
notification(newVal, oldVal) {
if (newVal !== oldVal) {
this.NotificationsTimer()
}
}
}
}
</script>
<style>
</style>