[bug fix]: tabs dynamic generate bug (#284)

This commit is contained in:
张敏
2017-11-06 00:20:31 -06:00
committed by GitHub
parent 3f7985ed2e
commit 616238b9d4
2 changed files with 51 additions and 23 deletions

View File

@@ -47,6 +47,19 @@ export default {
index
});
}
},
destroyed() {
const key = this.key;
const tabs = this.parentGroup.tabs;
for (let i = 0; i < tabs.length; i++) {
/* istanbul ignore else */
if (tabs[i].index === key) {
this.parentGroup.tabs.splice(i, 1);
return;
}
}
}
};
</script>