mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-23 17:55:37 +08:00
修改个人主页的url规则
This commit is contained in:
@@ -118,16 +118,9 @@
|
||||
Profess:[]
|
||||
}
|
||||
},
|
||||
// watch:{
|
||||
// '$route' (to, from) { //监听路由是否变化
|
||||
// if(to.query.id != from.query.id && from.path == "/home/index"){
|
||||
// this.id = to.query.id;
|
||||
// this.init();//重新加载数据
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
created(){
|
||||
if(this.$route.query.id && this.$route.query.id!=''){
|
||||
this.pageId = this.$xpage.getHomeId(this.$route);
|
||||
if(this.pageId && this.pageId!=''){
|
||||
this.init();
|
||||
}else{
|
||||
//this.$message.error("参数错误");
|
||||
@@ -135,12 +128,22 @@
|
||||
this.$router.push({path:'/404'})
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$route' (to, from) { //监听路由是否变化
|
||||
console.log(from,'from')
|
||||
if(to.params.id != from.params.id){
|
||||
this.pageId = to.params.id;
|
||||
console.log(this.pageId,'重新加载页面');
|
||||
this.init();//重新加载数据
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
init(){
|
||||
this.pageId = this.$route.query.id;
|
||||
|
||||
this.getList();
|
||||
if(this.pageId == this.userInfo.aid) {
|
||||
this.personal = true;
|
||||
|
||||
Reference in New Issue
Block a user