Files
wxapp_escort/custom-tab-bar/index.wxml
T
2026-10-02 10:28:44 +08:00

19 lines
526 B
Plaintext

<view class="tab-bar">
<view
class="tab-item {{ selected === index ? 'is-active' : '' }}"
wx:for="{{ list }}"
wx:key="pagePath"
data-index="{{ index }}"
data-path="{{ item.pagePath }}"
bindtap="onTap"
>
<!-- 三个 tab 共用同一套线性图标,选中态只换颜色、不换图形 -->
<t-icon
name="{{ item.icon }}"
size="44rpx"
color="{{ selected === index ? activeColor : inactiveColor }}"
/>
<text class="tab-text">{{ item.text }}</text>
</view>
</view>