修复路由问题

This commit is contained in:
q4speed 2020-05-18 16:02:47 +08:00
parent 2c72992390
commit b92cd0bedb
2 changed files with 17 additions and 8 deletions

View File

@ -60,10 +60,7 @@
},
watch: {
'$route'(to) {
this.testId = to.params.testId;
this.search();
}
'$route': 'init',
},
methods: {
@ -103,7 +100,15 @@
}
}
});
},
init() {
this.testId = this.$route.params.testId;
this.search();
}
},
created() {
this.init();
}
}
</script>

View File

@ -64,10 +64,7 @@
},
watch: {
'$route'(to) {
this.projectId = to.params.projectId;
this.search();
}
'$route': 'init'
},
methods: {
@ -110,7 +107,14 @@
}
}
});
},
init() {
this.projectId = this.$route.params.projectId;
this.search();
}
},
created() {
this.init();
}
}
</script>