1. 首页
  2. 行业
  3. 教育
  4. vue离开当前页面触发的函数代码

vue离开当前页面触发的函数代码

上传者: 2020-11-26 16:32:11上传 PDF文件 24.92KB 热度 12次
我就废话不多说了,大家还是直接看代码吧~ destroyed(){ console.log('销毁') } 补充知识:vue中进入路由页面和离开路由页面后执行函数 进入路由页面 mounted(){ this.$nextTick(()=>{ show(); }) } 离开路由页面后执行函数 destroyed: function () { console.log("我已经离开了!"); this.stopTimer(); }, 说明:destroyed是与methods、mounted同层级的 mounted(){ this.startTim
下载地址
用户评论