监控$route无效
必须是在当前页面的路由有子路由时,才能监控到,不然无效
beforeRouteUpdate (to, from, next) { console.log(to) console.log(from) next() } watch: { $route (to, from) { console.log(to) console.log(from) } }
必须是在当前页面的路由有子路由时,才能监控到,不然无效
beforeRouteUpdate (to, from, next) { console.log(to) console.log(from) next() } watch: { $route (to, from) { console.log(to) console.log(from) } }