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>
<up-tabbar
v-if="customTabbarEnable"
v-model:current="tabbarStore.curIdx"
:value="tabbarStore.curIdx"
active-color="#d81e06"
inactive-color="#7d7e80"
bordered
safeareainsetbottom
placeholder
@ -56,10 +58,19 @@ onLoad(() => {
:text="item.text"
:name="idx"
>
<template #icon>
<template #active-icon>
<view
h-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']"
/>
</template>

View File

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