//监听
watch: {
//监听路由
'$route' (to, from) { //监听路由是否变化
console.log(to.path);
if(to.path == "/Jindex/JuserindexAdd"){
}
}
},
升级
//监听
watch: {
//监听路由
'$route' (to, from) { //监听路由是否变化
let urlPath = ['/order/order','/order/listDate'];
console.log(to.path);
//判断数组中是否存在,// 不存在=>返回-1,存在返回下标
let boot = urlPath.indexOf(to.path);
if(boot){
console.log(boot)
}else{
console.log(boot)
}
}
},