监控$route无效

必须是在当前页面的路由有子路由时,才能监控到,不然无效

 beforeRouteUpdate (to, from, next) {
      console.log(to)
      console.log(from)
      next()
    }



    watch: {
      $route (to, from) {
        console.log(to)
        console.log(from)
      }
    }

 

posted @ 2020-08-21 14:45  zhaobao1830  阅读(370)  评论(1编辑  收藏  举报