Files
vuefilemanager/resources/js/components/Others/Notifications/ToasterWrapper.vue
T
2022-01-28 11:41:13 +01:00

25 lines
642 B
Vue

<template>
<div v-if="notifications.length > 0" class="fixed lg:bottom-8 bottom-4 lg:right-8 right-4 md:left-auto left-4 z-50">
<ToasterItem :item="item" v-for="(item, i) in notifications" :key="i"/>
</div>
</template>
<script>
import ToasterItem from "./ToasterItem";
import {events} from '../../../bus'
export default {
components: {
ToasterItem,
},
data() {
return {
notifications: []
}
},
created() {
events.$on('toaster', notification => this.notifications.push(notification))
}
}
</script>