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() {