动态计算在个人主页切换其它人员主页时的路径问题

This commit is contained in:
daihh
2022-10-14 18:48:12 +08:00
parent 052dbb0718
commit 86dd1fd39f

View File

@@ -130,11 +130,11 @@
}, },
watch:{ watch:{
'$route' (to, from) { //监听路由是否变化 '$route' (to, from) { //监听路由是否变化
console.log(from,'from') //console.log(from,'from')
if(to.params.id != from.params.id){ if(to.params.id != from.params.id){
this.pageId = to.params.id; this.pageId = to.params.id;
console.log(this.pageId,'重新加载页面'); let urlPre=window.location.protocol+'//'+window.location.host;
this.init();//重新加载数据 location.href=urlPre+process.env.VUE_APP_PUBLIC_PATH+this.$xpage.getHomePath(this.pageId);
} }
} }
}, },