feat(tabbar): 更新tabbar策略并优化样式

This commit is contained in:
feige996 2025-06-22 11:24:10 +08:00
parent b8c593e957
commit ee383968a5
2 changed files with 14 additions and 3 deletions

View File

@ -36,7 +36,9 @@ onLoad(() => {
<template> <template>
<up-tabbar <up-tabbar
v-if="customTabbarEnable" v-if="customTabbarEnable"
v-model:current="tabbarStore.curIdx" :value="tabbarStore.curIdx"
active-color="#d81e06"
inactive-color="#7d7e80"
bordered bordered
safeareainsetbottom safeareainsetbottom
placeholder placeholder
@ -56,10 +58,19 @@ onLoad(() => {
:text="item.text" :text="item.text"
:name="idx" :name="idx"
> >
<template #icon> <template #active-icon>
<view <view
h-40rpx h-40rpx
w-40rpx w-40rpx
class="text-[#d81e06]"
:class="[item.icon, idx === tabbarStore.curIdx ? 'is-active' : 'is-inactive']"
/>
</template>
<template #inactive-icon>
<view
h-40rpx
w-40rpx
class="text-[#7d7e80]"
:class="[item.icon, idx === tabbarStore.curIdx ? 'is-active' : 'is-inactive']" :class="[item.icon, idx === tabbarStore.curIdx ? 'is-active' : 'is-inactive']"
/> />
</template> </template>

View File

@ -9,7 +9,7 @@
*/ */
// TODO通过这里切换使用tabbar的策略 // TODO通过这里切换使用tabbar的策略
export const selectedTabbarStrategy = 0 export const selectedTabbarStrategy = 1
// 0 和 1 时需要tabbar缓存 // 0 和 1 时需要tabbar缓存
export const cacheTabbarEnable = selectedTabbarStrategy < 2 export const cacheTabbarEnable = selectedTabbarStrategy < 2