aboutsummaryrefslogtreecommitdiff
path: root/src/site
diff options
context:
space:
mode:
Diffstat (limited to 'src/site')
-rw-r--r--src/site/layouts/default.vue17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/site/layouts/default.vue b/src/site/layouts/default.vue
index 08d733f..579a73e 100644
--- a/src/site/layouts/default.vue
+++ b/src/site/layouts/default.vue
@@ -19,21 +19,22 @@ export default {
Navbar,
Footer
},
- computed: mapState(['config', 'alert']),
- watch: {
- 'alert.text'() {
- console.log('aaaaaaaa');
- if (!this.alert.text) return;
+ computed: mapState(['config']),
+ created() {
+ this.$store.watch(state => state.alert.text, () => {
+ const { text, error } = this.$store.state.alert;
+
+ if (!text) return;
this.$buefy.toast.open({
duration: 3500,
- message: this.alert.text,
+ message: text,
position: 'is-bottom',
- type: this.alert.error ? 'is-danger' : 'is-success'
+ type: error ? 'is-danger' : 'is-success'
});
this.$store.dispatch('alert/clear', null);
- }
+ })
},
mounted() {
console.log(