index.wxml 1.2 KB

12345678910111213
  1. <view wx:if="{{show}}" class="tab-bar tab-bar-{{position}}" style='background: {{backgroundImg? "url("+ backgroundImg+ ")" : backgroundColor}}'>
  2. <view class="tab-bar-border" style="background: {{borderStyle}}"></view>
  3. <view wx:for="{{list}}" wx:for-index="idx" wx:key="index" class="tab-bar-item {{item.style === 'circle' ? 'circle': ''}}" data-path="{{item.pagePath}}" data-index="{{idx}}" mut-bind:tap="switchTab">
  4. <view wx:if="{{item.style === 'circle'}}" class="item-circle"></view>
  5. <image class="tab-bar-item-image" wx:if="{{item.style !== 'circle'}}" style="height: {{item.iconSize}}rpx; width: {{item.iconSize}}rpx" src="{{selected === idx ? item.selectedIconPath : item.iconPath}}"></image>
  6. <image wx:else class="tab-bar-item-image"></image>
  7. <image class="center-circle" wx:if="{{item.style === 'circle'}}" src="{{selected === idx ? item.selectedIconPath : item.iconPath}}"></image>
  8. <view style="font-size: {{fontSize}}rpx ;color: {{selected === idx ? selectedColor : color}}">{{item.text}}</view>
  9. <view wx:if="{{item.redDot}}" class="reddot"></view>
  10. <view wx:if="{{item.badge}}" class="badge">{{item.badge}}</view>
  11. </view>
  12. </view>