1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-09 15:17:50 +00:00
bramw_baserow/web-frontend/components/notifications/Notification.vue
2019-08-26 17:49:28 +00:00

42 lines
875 B
Vue

<template>
<div
class="alert alert-with-shadow alert-has-icon"
:class="notificationClass"
>
<a class="alert-close" @click="close(notification)">
<i class="fas fa-times"></i>
</a>
<div class="alert-icon">
<i class="fas fa-exclamation"></i>
</div>
<div class="alert-title">{{ notification.title }}</div>
<p class="alert-content">{{ notification.message }}</p>
</div>
</template>
<script>
export default {
name: 'Notification',
props: {
notification: {
type: Object,
required: true
}
},
computed: {
notificationClass() {
return 'alert-' + this.notification.type
}
},
mounted() {
setTimeout(() => {
this.close(this.notification)
}, 5000)
},
methods: {
close(notification) {
this.$store.dispatch('notification/remove', notification)
}
}
}
</script>