修复路由问题
This commit is contained in:
parent
7991950025
commit
2c72992390
|
@ -73,7 +73,7 @@
|
||||||
return '/api/' + item.id;
|
return '/api/' + item.id;
|
||||||
},
|
},
|
||||||
router: function (item) {
|
router: function (item) {
|
||||||
return {name: 'fucPlan', params: {projectId: item.id, projectName: item.name}}
|
return {name: 'ApiTestList', params: {projectId: item.id, projectName: item.name}}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
testRecent: {
|
testRecent: {
|
||||||
|
|
|
@ -59,11 +59,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeRouteEnter(to, from, next) {
|
watch: {
|
||||||
next(self => {
|
'$route'(to) {
|
||||||
self.testId = to.params.testId;
|
this.testId = to.params.testId;
|
||||||
self.search();
|
this.search();
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -63,11 +63,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeRouteEnter(to, from, next) {
|
watch: {
|
||||||
next(self => {
|
'$route'(to) {
|
||||||
self.projectId = to.params.projectId;
|
this.projectId = to.params.projectId;
|
||||||
self.search();
|
this.search();
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -34,7 +34,9 @@
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route'(to) {
|
'$route'(to) {
|
||||||
this.activeIndex = to.matched[0].path;
|
if (to.matched.length > 0) {
|
||||||
|
this.activeIndex = to.matched[0].path;
|
||||||
|
}
|
||||||
this.handleSelect(this.activeIndex);
|
this.handleSelect(this.activeIndex);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue