0👍
It looks like I needed to set deep: true
on the watcher.
computed: {
authorized: {
let authenticated = this.$store.getters.getUserAuthStatus;
let route = this.$route;
if (authenticated !== true && route.meta.requiresLogin === true) {
return false;
}
else {
return true;
}
}
},
watch: {
authorized: {
handler: function(val) {
if (val === false) {
this.$router.push('/signin');
this.$store.commit('setGlobalInfo', 'Please sign in first.');
}
},
deep: true;
}
- [Vuejs]-How to access imported vue component's instance outside main vue component?
- [Vuejs]-Dynamic CSS Grid using Vue
Source:stackexchange.com