方法一:
beforeRouteUpdate (to, from, next) {
this.lang = to.params.lang;
this.setCode();
next();
}
方法二:
<router-view :key="$route.fullPath" />
方法三:
在页面里监听路由变化
wathch:{
$route:function(newVal,oldVal){
}
}
方法四:
window 的hashchange事件
window.addEventListner("hashchange",()=>{})