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