vue 监视路由的方法
watch:{
'$route':'isTab'
},
methods:{
isTab(){
if(this.$route.path==='/index'||this.$route.path==='/gameHall'||this.$route.path==='/car'||this.$route.path==='/par'){
this.$refs.tabItem.style.display = 'flex';
}else {
this.$refs.tabItem.style.display = 'none';
}
}
}
简单明了

浙公网安备 33010602011771号