0👍
Trying adding the validation on updated
hook, there is when the component has changed, something like:
export default {
name: "Hero",
data() {
return {
heroFull: false,
};
},
updated() {
if (this.$route.path === "/") {
this.heroFull = true;
console.log("its at home");
} else {
this.heroFull = false;
console.log("its not at home");
}
}
};
Source:stackexchange.com