From 3f7e4f5dc89127eeab326fbc4b31a545f515a376 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 20 十月 2025 15:24:15 +0800
Subject: [PATCH] fix: bug
---
apps/cMiniApp/src/custom-tab-bar/index.tsx | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/apps/cMiniApp/src/custom-tab-bar/index.tsx b/apps/cMiniApp/src/custom-tab-bar/index.tsx
index 5626e58..aa19d04 100644
--- a/apps/cMiniApp/src/custom-tab-bar/index.tsx
+++ b/apps/cMiniApp/src/custom-tab-bar/index.tsx
@@ -29,7 +29,8 @@
const TarBarItem = function (props: TarBarItemProps, context: SetupContext<TarBarItemEvents>) {
const _badge = props.badge > 99 ? '99+' : props.badge;
- const isActive = props.currentPath.toLowerCase().includes(props.pagePath.toLowerCase());
+ // const isActive = props.currentPath.toLowerCase().includes(props.pagePath.toLowerCase());
+ const isActive = props.active;
return (
<div
class={['bottom-tab-item', { active: isActive }, props.className]}
@@ -112,6 +113,7 @@
}
return () => {
+ const _router = Taro.useRouter();
return (
<View
class="bottom-tab"
@@ -124,7 +126,7 @@
icon="../assets/tabbar/icon-home.png"
activeIcon="../assets/tabbar/icon-home-active.png"
pagePath={TabBarPageRouter.Home}
- currentPath={router.path}
+ currentPath={_router.path}
index={0}
active={system.activeTab === 0}
className="home"
@@ -136,7 +138,7 @@
icon="../assets/tabbar/icon-task.png"
activeIcon="../assets/tabbar/icon-task-active.png"
pagePath={TabBarPageRouter.Task}
- currentPath={router.path}
+ currentPath={_router.path}
active={system.activeTab === 1}
className="task"
onClick={switchTab}
@@ -147,7 +149,7 @@
icon="../assets/tabbar/icon-mine.png"
activeIcon="../assets/tabbar/icon-mine-active.png"
pagePath={TabBarPageRouter.Mine}
- currentPath={router.path}
+ currentPath={_router.path}
active={system.activeTab === 2}
className="mine"
onClick={switchTab}
--
Gitblit v1.9.1