修复路由问题

This commit is contained in:
q4speed 2020-05-18 15:45:11 +08:00
parent 7991950025
commit 2c72992390
4 changed files with 14 additions and 12 deletions

View File

@ -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: {

View File

@ -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: {

View File

@ -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: {

View File

@ -34,7 +34,9 @@
}, },
watch: { watch: {
'$route'(to) { '$route'(to) {
if (to.matched.length > 0) {
this.activeIndex = to.matched[0].path; this.activeIndex = to.matched[0].path;
}
this.handleSelect(this.activeIndex); this.handleSelect(this.activeIndex);
} }
}, },