litian
2024-03-25 1fd211c2528c8ba7fff173c60b31acbc5807c809
custom-tab-bar/index.wxml
@@ -1,12 +1,18 @@
<t-tab-bar value="{{active}}" bindchange="onChange" split="{{false}}">
<!-- <t-tab-bar value="{{active}}" bindchange="onChange" split="{{false}}">
  <t-tab-bar-item wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="id">
    <view class="custom-tab-bar-wrapper">
      <!-- <t-icon prefix="wr" name="{{item.icon}}" size="48rpx" />
      <view class="text">{{ item.text }}</view> -->
      <!-- <t-image wx:if="{{active !== index}}" class="tabImg" src="{{item.icon}}" mode="heightFix" width="22" height="22" />
      <t-image wx:else class="tabImg" src="{{item.activeIcon}}" mode="heightFix" width="22" height="22" /> -->
      <t-image class="tabImg" src="{{active == item.id ? item.activeIcon : item.icon}}" width="22" height="22"></t-image>
      <view class="text">{{ item.text }}</view>
    </view>
  </t-tab-bar-item>
</t-tab-bar>
</t-tab-bar> -->
<view class="tabBarBox">
  <view class="tabItem" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="changeTab" data-num="{{index}}">
    <view class="custom-tab-bar-wrapper">
      <t-image wx:if="{{selected !== index}}" class="tabImg" src="{{item.icon}}" mode="aspectFill" width="22" height="22" />
      <t-image wx:else class="tabImg" src="{{item.activeIcon}}" mode="aspectFill" width="22" height="22" />
      <view class="text {{selected == index ? 'activeText' : ''}}">{{ item.text }}</view>
    </view>
  </view>
</view>