watch: {
//监听路由变化
'$route' (to, from) {
if(to.name == 'search' || from.name == 'search') {
//重新调用接口
test();
}
}
},
watch: {
//监听路由变化
'$route' (to, from) {
if(to.name == 'search' || from.name == 'search') {
//重新调用接口
test();
}
}
},
本文标题:router(Vue路由监控重新调用接口)
本文链接:https://www.haomeiwen.com/subject/otysictx.html
网友评论