<view class="tab-bar">
  <view
    wx:for="{{tabs}}"
    wx:key="pagePath"
    class="tab-bar-item {{selected === index ? 'active' : ''}}"
    data-index="{{index}}"
    data-pagepath="{{item.pagePath}}"
    bindtap="switchTab"
  >
    <image
      wx:if="{{item.icon}}"
      class="tab-icon"
      src="{{selected === index ? item.activeIcon : item.icon}}"
      mode="aspectFit"
    />
    <view wx:else class="tab-icon tab-icon-text">{{item.iconText}}</view>
    <view class="tab-text">{{item.text}}</view>
  </view>
</view>
