|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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]} | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return () => { | 
|---|
|  |  |  | const _router = Taro.useRouter(); | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <View | 
|---|
|  |  |  | class="bottom-tab" | 
|---|
|  |  |  | 
|---|
|  |  |  | 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" | 
|---|
|  |  |  | 
|---|
|  |  |  | icon="../assets/tabbar/icon-task.png" | 
|---|
|  |  |  | activeIcon="../assets/tabbar/icon-task-active.png" | 
|---|
|  |  |  | pagePath={TabBarPageRouter.Workbenches} | 
|---|
|  |  |  | currentPath={router.path} | 
|---|
|  |  |  | currentPath={_router.path} | 
|---|
|  |  |  | active={system.activeTab === 1} | 
|---|
|  |  |  | className="task" | 
|---|
|  |  |  | onClick={switchTab} | 
|---|
|  |  |  | 
|---|
|  |  |  | 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} | 
|---|