获取当前页面由哪个路由跳转,点击返回按钮时返回相应的页面
data () {
return {
leavpath: ''
}
},
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.fullPath === '/路径') {
vm.leavpath = '/路径'
}
})
}
from.fullPath:可以获取到进入页面的路径。
beforeRouteEnter 守卫 不能 访问 thi..
原创
2021-10-27 17:49:42 ·
399 阅读 ·
0 评论