From 6629e34dff1247d9aca911b6e208496b29dd3193 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Wed, 4 Nov 2020 11:05:50 +0800 Subject: [PATCH] fix(h5): customTabBar.vue --- src/platforms/h5/components/app/customTabBar.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/platforms/h5/components/app/customTabBar.vue b/src/platforms/h5/components/app/customTabBar.vue index 7d1e9715ac..986c87a8a9 100644 --- a/src/platforms/h5/components/app/customTabBar.vue +++ b/src/platforms/h5/components/app/customTabBar.vue @@ -89,6 +89,16 @@ export default { return true } }, + watch: { + '$route' (to, from) { + if (to.meta.isTabBar) { + const index = tabBar.list.findIndex(item => to.meta.pagePath === item.pagePath) + if (index > -1) { + this.selectedIndex = index + } + } + } + }, methods: { _getRealPath (filePath) { if (filePath.indexOf('/') !== 0) { -- GitLab