mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-19 15:56:45 +08:00
动态计算在个人主页切换其它人员主页时的路径问题
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user