diff --git a/packages/taro-router/src/tabbar.ts b/packages/taro-router/src/tabbar.ts index 7ef78f63c036..53bb742ac785 100644 --- a/packages/taro-router/src/tabbar.ts +++ b/packages/taro-router/src/tabbar.ts @@ -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)