From c955de647b5f70d7c8d77c889f67dad1dbcf048a Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 30 Aug 2022 14:45:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=89=93=E5=BC=80=E5=85=B3=E9=97=AD=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8D=A1=E9=A1=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/components/api/definition/ApiDefinition.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index 75288d9376..d715e7de04 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -33,7 +33,7 @@ class="ms-api-button" ref="environmentSelect"/> - + @@ -441,6 +441,7 @@ export default { if (!this.trashEnable) { this.apiDefaultTab = "default"; } + }, redirectID() { this.renderComponent = false; @@ -448,6 +449,7 @@ export default { // 在 DOM 中添加 my-component 组件 this.renderComponent = true; }); + }, '$route'(to, from) { // 路由改变时,把接口定义界面中的 ctrl s 保存快捷键监听移除 if (to.path.indexOf('/api/definition') === -1) { @@ -728,14 +730,15 @@ export default { if (tab.name === targetName) { let nextTab = tabs[index + 1] || tabs[index - 1]; if (nextTab) { + tab.api = undefined; activeName = nextTab.name; } } }); } - this.apiDefaultTab = activeName; + this.apiDefaultTab = activeName this.apiTabs = tabs.filter(tab => tab.name !== targetName); - this.refresh(); + this.$refs.mainTabs.$children = []; }, //创建左侧树的根目录模块 createRootModel() {