fix 暂时取消组件销毁操作

This commit is contained in:
2021-05-13 14:31:56 +08:00
parent 3014942bf0
commit dc4b0a9294

View File

@@ -83,11 +83,12 @@ export default {
const pane = this.panes.find((p) => p.key === key);
// 打开之前先销毁
const index = this.panes.indexOf(pane);
const component = this.$refs.panes && this.$refs.panes[index];
if (component) {
component.$destroy();
}
// 销毁后重新生成的组件会放置到$refs.panes的最后,所以这里直接根据索引取是错误的
// const index = this.panes.indexOf(pane);
// const component = this.$refs.panes && this.$refs.panes[index];
// if (component) {
// component.$destroy();
// }
const i = import(`@/pages${pane.path}`);
pane.component = () => i;