diff --git a/src/platforms/h5/components/app/customTabBar.vue b/src/platforms/h5/components/app/customTabBar.vue index 7d1e9715ac98993d63d8b1fa745e4d53e2cf71c8..986c87a8a924f6fd3146af3e617d67671ace1bb6 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) {