From a4f6651bfba7329fa02895044b0de8e7f993980a Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Sat, 9 May 2020 13:10:54 +0800 Subject: [PATCH] fix(h5): redirectTo on the tabBar page --- src/core/service/plugins/app/router-guard.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/core/service/plugins/app/router-guard.js b/src/core/service/plugins/app/router-guard.js index 96ae2a53b0..27ec5e19f2 100644 --- a/src/core/service/plugins/app/router-guard.js +++ b/src/core/service/plugins/app/router-guard.js @@ -104,13 +104,14 @@ function beforeEach (to, from, next, routes) { if (from.meta.isQuit) { // 如果 redirectTo 的前一个页面是 quit 类型,则新打开的页面也是 quit to.meta.isQuit = true to.meta.isEntry = !!from.meta.isEntry - } - if (from.meta.isTabBar) { // 如果是 tabBar,需要更新系统组件 tabBar 内的 list 数据 - to.meta.isTabBar = true - to.meta.tabBarIndex = from.meta.tabBarIndex - const appVm = getApp().$children[0] - appVm.$set(appVm.tabBar.list[to.meta.tabBarIndex], 'pagePath', to.meta.pagePath) - } + } + // 小程序没有这个逻辑,当时为何加了保留并更新 tabBar 的逻辑? + // if (from.meta.isTabBar) { // 如果是 tabBar,需要更新系统组件 tabBar 内的 list 数据 + // to.meta.isTabBar = true + // to.meta.tabBarIndex = from.meta.tabBarIndex + // const appVm = getApp().$children[0] + // appVm.$set(appVm.tabBar.list[to.meta.tabBarIndex], 'pagePath', to.meta.pagePath) + // } } break -- GitLab