From 965ece0a7c4e9f9521155eeef9a361939bccd529 Mon Sep 17 00:00:00 2001 From: xiaoyucoding Date: Thu, 6 Dec 2018 15:15:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BB=B6=E8=BF=9F=E6=89=A7=E8=A1=8C=20o?= =?UTF-8?q?nShow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/service/plugins/app/router-guard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/service/plugins/app/router-guard.js b/src/core/service/plugins/app/router-guard.js index 4e5733df8..99d08e699 100644 --- a/src/core/service/plugins/app/router-guard.js +++ b/src/core/service/plugins/app/router-guard.js @@ -123,7 +123,10 @@ function afterEach (to, from) { // 直接获取所有 pages,getCurrentPages 正常情况下仅返回页面栈内,传 true 则返回所有已存在(主要是 tabBar 页面) const toVm = getCurrentPages(true).find(pageVm => pageVm.$page.id === toId) if (toVm) { // 目标页面若已存在,则触发 onShow - callPageHook(toVm, 'onShow') + // 延迟执行 onShow,防止与 UniServiceJSBridge.emit('onHidePopup') 冲突。 + setTimeout(function () { + callPageHook(toVm, 'onShow') + }, 0) } } } -- GitLab