From cfe3d220289090f1939fcc218f8ccc8169d69c85 Mon Sep 17 00:00:00 2001 From: mehaotian <490272692@qq.com> Date: Tue, 9 Apr 2019 16:17:23 +0800 Subject: [PATCH] =?UTF-8?q?updata:=20=20=20=E9=87=8D=E6=96=B0reLaunch?= =?UTF-8?q?=E8=87=B3=E9=A6=96=E9=A1=B5=E5=8F=AF=E8=83=BD=E4=BC=9A=E8=A2=AB?= =?UTF-8?q?keepAlive=EF=BC=8C=E5=85=88=E6=89=8B=E5=8A=A8=E5=BC=BA=E5=88=B6?= =?UTF-8?q?destroy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/service/plugins/app/router-guard.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/service/plugins/app/router-guard.js b/src/core/service/plugins/app/router-guard.js index a50899bdd6..d1e128c64d 100644 --- a/src/core/service/plugins/app/router-guard.js +++ b/src/core/service/plugins/app/router-guard.js @@ -33,7 +33,9 @@ function reLaunch (toName) { // 关闭所有页面 const pages = getCurrentPages() for (let i = pages.length - 1; i >= 0; i--) { - callPageHook(pages[i], 'onUnload') + callPageHook(pages[i], 'onUnload') + // 重新reLaunch至首页可能会被keepAlive,先手动强制destroy + pages[i].$destroy() } this.keepAliveInclude = [] } -- GitLab