使用tabbar时,created不管如何切换tabbar,都只加载一次。这时我们就需要通过监听路由。来模拟代替他们的功能。
watch: {
$route(){
console.log("成功!")
let that = this;
if(非定时器页面){
clearInterval(that.timer_interval);
that.timer_interval = null;
}else{
created中需要执行的代码
}
}
},
使用tabbar时,created不管如何切换tabbar,都只加载一次。这时我们就需要通过监听路由。来模拟代替他们的功能。
watch: {
$route(){
console.log("成功!")
let that = this;
if(非定时器页面){
clearInterval(that.timer_interval);
that.timer_interval = null;
}else{
created中需要执行的代码
}
}
},