vue中进入路由页面和离开路由页面后执行函数
进入路由页面mounted(){this.$nextTick(()=>{show();})}离开路由页面后执行函数destroyed: function () {console.log("我已经离开了!");this.stopTimer();},说明:destroyed是与methods、...
·
进入路由页面
mounted(){
this.$nextTick(()=>{
show();
})
}
离开路由页面后执行函数
destroyed: function () {
console.log("我已经离开了!");
this.stopTimer();
},
说明:destroyed是与methods、mounted同层级的
mounted(){
this.startTimer();
},
//离开当前页面后执行
destroyed: function () {
this.stopTimer();
},
更多推荐
已为社区贡献2条内容
所有评论(0)