问题描述
路由跳转没监听到
问题出现的环境背景及自己尝试过哪些方法
beforeRouteEnter (to, from, next) {
console.log('ooo')
},
'$route' :{ //失效,路由改变了不知道为什么不走
handler:function(to,from){
console.log(to,from)
// if(to.path == '/'){
// /**
// * $store来自Store对象
// * dispatch 向 actions 发起请求
// */
// this.$store.dispatch('showTabBar');
// }else{
// this.$store.dispatch('hideTabBar');
// }
},
deep:true
},
'$route'(to, from) {
console.log(to,from)
console.log('ooo')
},
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)