Level 63
Have you updated the state value ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
here is my computed and watch methods in my App.vue
computed: {
...mapState({
autoLogout: (state) => state.autoLogout,
}),
},
watch: {
autoLogout(curValue, oldValue) {
console.log("curVal and oldVal", curValue, oldValue);
if (curValue && curValue != oldValue) {
console.log("redirect to login");
this.$router.replace("/login");
}
},
},
nothing is being logged in the console, yes autoLogout state is changing from false to true but the watch is not triggering?!
Please or to participate in this conversation.