// vue路由监听 $route: { // 深度观察监听 deep: true, handler(v) { //console.log("v", v) this.routePath() } }, 或者 // 监听,当路由发生变化的时候执行 watch: { '$route':'routePath' }, methods: { routePath(){ console.log(this.$route.path); } }