topic description
the root component tab switches, watch snooping route triggers, but beforeRouteUpdate does not trigger
related codes
<footer class="tabBar">
<router-link to="/home">
<span></span>
</router-link>
<router-link to="/noticeCenter">
<span></span>
</router-link>
<router-link to="/myCenter">
<span></span>
</router-link>
</footer>
<router-view></router-view>
export default {
data() {
return {};
},
methods: {}
},
watch: {
$route(to, from) {
console.log(to);
console.log(from);
}
}
beforeRouteUpdate(to, from, next) {
console.log(to);
console.log(from);
next();
}
};
routes: [
{ path: "/", redirect: "/home" },
{ path: "/home", component: home }, //
{ path: "/noticeCenter", component: noticeCenter }, //
{ path: "/myCenter",name: "myCenter",component: myCenter } //
]