diff --git a/frontend/src/business/components/api/report/ApiReportList.vue b/frontend/src/business/components/api/report/ApiReportList.vue index 7594d03708..b1698a47e6 100644 --- a/frontend/src/business/components/api/report/ApiReportList.vue +++ b/frontend/src/business/components/api/report/ApiReportList.vue @@ -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(); } } diff --git a/frontend/src/business/components/api/test/ApiTestList.vue b/frontend/src/business/components/api/test/ApiTestList.vue index 277f616d5f..f5ecb7edf8 100644 --- a/frontend/src/business/components/api/test/ApiTestList.vue +++ b/frontend/src/business/components/api/test/ApiTestList.vue @@ -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(); } }