watch: {
$route: {
handler: function(val, oldVal){
// 参数为to from最好理解,所以写成 handler: function(to, from)最好
let nowChildPath = val.fullPath.toLowerCase();
if(nowChildPath.indexOf('orderlist') === -1 && nowChildPath.indexOf('orderdetail') === -1){
this.$store.dispatch('order/tabName', { tabName: 0 });
}
}
}
},
监听路由的变化
最新推荐文章于 2024-05-14 19:33:50 发布