vue 监听路由变化,dom加载完成后执行代码
watch 监听路由变化,且dom渲染完成后执行函数
watch:{ // "$route": "monitorAPP" $route: { handler:function(val, oldVal){ this.$nextTick(function(){ //页面加载完成后执行 this.monitorAPP() }) }, // 深度观察监听 deep: true } }
watch:{ // "$route": "monitorAPP" $route: { handler:function(val, oldVal){ this.$nextTick(function(){ //页面加载完成后执行 this.monitorAPP() }) }, // 深度观察监听 deep: true } }