Skip to content

Commit

Permalink
fix: tabbar not support custom routes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Sep 18, 2020
1 parent b5f87c3 commit 3bd20e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/taro-router/src/tabbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ export function initTabbar (config: AppConfig) {
tabbar.conf.homePage = history.location.pathname === '/' ? homePage : history.location.pathname
const routerConfig = (config as any).router
tabbar.conf.mode = routerConfig && routerConfig.mode ? routerConfig.mode : 'hash'
tabbar.conf.custom = !!routerConfig.customRoutes
if (routerConfig.customRoutes) {
tabbar.conf.custom = true
tabbar.conf.customRoutes = routerConfig.customRoutes
} else {
tabbar.conf.custom = false
tabbar.conf.customRoutes = {}
}
const container = document.getElementById('container')
// eslint-disable-next-line no-unused-expressions
container?.appendChild(tabbar)
Expand Down

0 comments on commit 3bd20e8

Please sign in to comment.