需要分别对不同的路径,进行不同的操作
做路由监听变化即可:
watch : {
'$route' (to, from) {
// from 对象中要 router 来源信息.
// do your want
}
}
beforeRouteEnter (to, from, next) {
console.log(to)
console.log(from)
console.log(next)
next();
}
