Add notifications

This commit is contained in:
2020-06-09 02:59:15 +02:00
parent ff829e5922
commit 7c92d9d9bc
6 changed files with 51 additions and 12 deletions
+15
View File
@@ -6,6 +6,9 @@
<v-row no-gutters justify="center">
<nuxt />
</v-row>
<v-snackbar v-model="toast" :color="color">{{
msg
}}</v-snackbar>
</v-container>
</v-content>
</v-app>
@@ -16,6 +19,18 @@ import Navbar from '@/components/Navbar'
export default {
components: { Navbar },
data: () => ({
toast: false,
color: '',
msg: '',
}),
mounted() {
this.$root.$on('toast', (msg, color) => {
this.msg = msg
this.color = color ?? ''
this.toast = true
})
},
}
</script>