vue组件跳转到当前组件地址栏参数改变组件内容却不刷新
同一路由刷新的问题
1:刷新当前页面
强制刷新整个页面来满足效果。但页面整体的刷新会使体验下降。
watch: {
'$route' (to, from) {
this.$router.go(0);
}}
2:路由变化重新获取数据
methods:{
getMsg(){
//接口请求数据
}
},
create(){
this.getMsg();
},
watch:{
"$route":"getMsg"
}