From d77ed8ac29309f02f7cb1a1f27aba7d44b78d060 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Thu, 21 Aug 2025 16:28:45 +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=90=AF=E7=94=A8=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加customTabbarEnable条件检查,确保仅在启用自定义tabbar时处理鼓包样式 --- src/tabbar/store.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tabbar/store.ts b/src/tabbar/store.ts index 4c48d67..b3600af 100644 --- a/src/tabbar/store.ts +++ b/src/tabbar/store.ts @@ -1,5 +1,5 @@ import type { CustomTabBarItem } from './config' -import { tabbarList as _tabbarList } from './config' +import { tabbarList as _tabbarList, customTabbarEnable } from './config' // TODO 1/2: 中间的鼓包tabbarItem的开关 const BULGE_ENABLE = true @@ -10,9 +10,9 @@ const tabbarList: CustomTabBarItem[] = _tabbarList.map(item => ({ pagePath: item.pagePath.startsWith('/') ? item.pagePath : `/${item.pagePath}`, })) -if (BULGE_ENABLE) { - if (tabbarList.length % 2 === 1) { - console.error('tabbar 数量必须是偶数,否则样式很奇怪!!') +if (customTabbarEnable && BULGE_ENABLE) { + if (tabbarList.length % 2) { + console.error('有鼓包时 tabbar 数量必须是偶数,否则样式很奇怪!!') } tabbarList.splice(tabbarList.length / 2, 0, { isBulge: true,