<!-- custom-tab-bar/index.wxml -->
<view class="tab-bar">
  <view 
    class="tab-item" 
    wx:for="{{tabList}}" 
    wx:key="pagePath"
    bindtap="switchTab"
    data-path="{{item.pagePath}}"
  >
    <!-- 图标：使用严格相等判断，确保状态准确 -->
    <image 
      class="icon" 
      src="{{currentPath === item.pagePath ? item.selectedIconPath : item.iconPath}}"
      mode="widthFix"  
    ></image>
    <view class="text {{currentPath === item.pagePath ? 'active' : ''}}">
      {{item.text}}
    </view>
  </view>
</view>

<!-- 调试信息（可选，发布前删除） -->
<view wx:if="{{false}}" style="position: fixed; top: 50px; left: 0; z-index: 999; background: white; padding: 10px; font-size: 12px;">
  当前路径：{{currentPath}}
  <view wx:for="{{tabList}}" wx:key="pagePath">
    {{item.text}}: {{item.pagePath}} → {{currentPath === item.pagePath ? '匹配' : '不匹配'}}
  </view>
</view>