refactor(接口测试): 优化接口定义页面打开关闭页面卡顿问题

This commit is contained in:
fit2-zhao 2022-08-30 14:45:50 +08:00 committed by fit2-zhao
parent a400c6e239
commit c955de647b
1 changed files with 6 additions and 3 deletions

View File

@ -33,7 +33,7 @@
class="ms-api-button"
ref="environmentSelect"/>
<!-- 主框架列表 -->
<el-tabs v-model="apiDefaultTab" @edit="closeConfirm" @tab-click="addTab" @tab-remove="removeTab">
<el-tabs v-model="apiDefaultTab" @edit="closeConfirm" @tab-click="addTab" @tab-remove="removeTab" ref="mainTabs">
<el-tab-pane
name="trash" :closable="true"
:label="$t('commons.trash')" v-if="trashEnable">
@ -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() {