From dc4b0a9294dd5a850568d1be6a43c45269b9a7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Thu, 13 May 2021 14:31:56 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=9A=82=E6=97=B6=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=94=80=E6=AF=81=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/src/views/main/_layout/content.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Web/src/views/main/_layout/content.vue b/Web/src/views/main/_layout/content.vue index 890b2d0..8c0399a 100644 --- a/Web/src/views/main/_layout/content.vue +++ b/Web/src/views/main/_layout/content.vue @@ -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;