vue中路由跳转后页面无数据问题
路由参数改变,页面数据不更新解决方法:
http://localhost:8080/#test?id=1
http://localhost:8080/#test?id=2,参数切换后,数据未更新
解决办法,亲测有效
watch: {
'$route' (to, from) {
this.$router.go(0);
}
}
methods:{
clickBtn(item) {
console.log("事件点击跳转");
this.$router.push("/index?tabs=" + item);
},
}

浙公网安备 33010602011771号