watch: {
$route(to, from) {
if(from.path == "/league_mgr/down_club_table" && to.path == "/club_mgr/club_find") {
this.openThisPage()
}
}
/*
$route: {
immediate: true, // watch中的监听,第一次创建的时候,不会立即执行,加上这个参数,会立即执行
handler(to, from) {
console.log("111 ------ ", to.name, to.path);
console.log("111 ------ ", from.name, from.path); // 注意,如果刷新页面,则没有from
},
},
*/
},
vue监听路由变化
于 2022-03-24 19:50:49 首次发布