From 477edaea1a75fb20507bf40328236108bdeaef78 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Sun, 17 Aug 2025 14:24:16 +0800 Subject: [PATCH] =?UTF-8?q?refactor(tabbar):=20=E5=88=87=E6=8D=A2=E4=B8=BA?= =?UTF-8?q?=E5=8E=9F=E7=94=9Ftabbar=E5=B9=B6=E6=B8=85=E7=90=86=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89tabbar=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除自定义tabbar的配置和代码,改为使用原生tabbar实现 清理未使用的http请求代码和TODO注释 更新相关配置文件和组件逻辑 --- src/pages.json | 2 +- src/tabbar/config.ts | 4 ++-- src/tabbar/index.vue | 12 ++++-------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/pages.json b/src/pages.json index 86b05f7..8c68a48 100644 --- a/src/pages.json +++ b/src/pages.json @@ -15,7 +15,7 @@ } }, "tabBar": { - "custom": true, + "custom": false, "color": "#999999", "selectedColor": "#018d71", "backgroundColor": "#F8F8F8", diff --git a/src/tabbar/config.ts b/src/tabbar/config.ts index 660ea2c..b6b8bd1 100644 --- a/src/tabbar/config.ts +++ b/src/tabbar/config.ts @@ -20,7 +20,7 @@ export const TABBAR_MAP = { // 如果是使用 NO_TABBAR(0),nativeTabbarList 和 customTabbarList 都不生效(里面的配置不用管) // 如果是使用 NATIVE_TABBAR(1),只需要配置 nativeTabbarList,customTabbarList 不生效 // 如果是使用 CUSTOM_TABBAR(2,3),只需要配置 customTabbarList,nativeTabbarList 不生效 -export const selectedTabbarStrategy = TABBAR_MAP.CUSTOM_TABBAR_WITH_CACHE +export const selectedTabbarStrategy = TABBAR_MAP.NATIVE_TABBAR type NativeTabBarItem = TabBar['list'][0] // TODO: 2/3. 使用 NATIVE_TABBAR 时,更新下面的 tabbar 配置 @@ -48,7 +48,7 @@ interface CustomTabBarItem { badge?: number | 'dot' // badge 显示一个数字或 小红点(样式可以直接在 tabbar/index.vue 里面修改) isBulge?: boolean // 是否是中间的鼓包tabbarItem } -// TODO: 2/3. 使用 CUSTOM_TABBAR(2,3) 时,更新下面的 tabbar 配置 +// TODO: 3/3. 使用 CUSTOM_TABBAR(2,3) 时,更新下面的 tabbar 配置 export const customTabbarList: CustomTabBarItem[] = [ { text: '首页', diff --git a/src/tabbar/index.vue b/src/tabbar/index.vue index 5979a24..66ebad6 100644 --- a/src/tabbar/index.vue +++ b/src/tabbar/index.vue @@ -1,6 +1,5 @@