From 96f47f121cbbd9a4b08bcbfb627b4909862bad19 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Thu, 21 Aug 2025 17:20:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(tabbar):=20=E4=BF=AE=E5=A4=8D=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89tabbar=E5=88=97=E8=A1=A8=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复当启用自定义tabbar时,直接导出未映射的列表导致显示异常的问题。现在正确使用映射后的_tabbarList作为底部栏配置。 --- src/tabbar/config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tabbar/config.ts b/src/tabbar/config.ts index 9fde129..d447273 100644 --- a/src/tabbar/config.ts +++ b/src/tabbar/config.ts @@ -117,7 +117,8 @@ export const customTabbarEnable */ export const needHideNativeTabbar = selectedTabbarStrategy === TABBAR_STRATEGY_MAP.CUSTOM_TABBAR_WITH_CACHE -export const tabbarList = customTabbarEnable ? customTabbarList.map(item => ({ text: item.text, pagePath: item.pagePath })) : nativeTabbarList +const _tabbarList = customTabbarEnable ? customTabbarList.map(item => ({ text: item.text, pagePath: item.pagePath })) : nativeTabbarList +export const tabbarList = customTabbarEnable ? customTabbarList : nativeTabbarList const _tabbar: TabBar = { // 只有微信小程序支持 custom。App 和 H5 不生效 @@ -130,7 +131,7 @@ const _tabbar: TabBar = { fontSize: '10px', iconWidth: '24px', spacing: '3px', - list: tabbarList as unknown as TabBar['list'], + list: _tabbarList as unknown as TabBar['list'], } // 0和1 需要显示底部的tabbar的各种配置,以利用缓存