fix: 复制场景修改场景名称后,tab页的名称没跟着变

修复复制场景修改场景名称后,tab页的名称没跟着变的问题
This commit is contained in:
song.tianyang 2021-01-27 18:10:04 +08:00
parent c9fdccf85e
commit 8e2bd2224e
2 changed files with 11 additions and 1 deletions

View File

@ -237,8 +237,18 @@
this.$refs.apiScenarioList.search(data);
},
refresh(data) {
this.setTabTitle(data);
this.$refs.apiScenarioList.search(data);
},
setTabTitle(data) {
for (let index in this.tabs) {
let tab = this.tabs[index];
if (tab.name === this.activeName) {
tab.label = data.name;
break;
}
}
},
editScenario(row) {
this.addTab({name: 'edit', currentScenario: row});
},

View File

@ -848,7 +848,7 @@
if (this.currentScenario.tags instanceof String) {
this.currentScenario.tags = JSON.parse(this.currentScenario.tags);
}
this.$emit('refresh');
this.$emit('refresh',this.currentScenario);
})
}
})