index.wxml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <view
  2. class="ant-tab-bar {{ className || '' }}"
  3. style="{{ style || '' }}">
  4. <view class="ant-tab-bar-wrap">
  5. <block
  6. wx:for="{{ items }}"
  7. wx:for-index="index"
  8. wx:for-item="item">
  9. <view
  10. class="ant-tab-bar-item {{ index === mixin.value ? 'ant-tab-bar-item-active ' + (activeClassName || '') : '' }}"
  11. style="{{ index === mixin.value ? activeStyle || '' : '' }}"
  12. bind:tap="onChange"
  13. data-index="{{ index }}">
  14. <ant-badge
  15. wx:if="{{ item.badge }}"
  16. type="{{ item.badge.type || 'dot' }}"
  17. text="{{ item.badge.text }}"
  18. stroke="{{ item.badge.stroke }}"
  19. bgColor="{{ item.badge.bgColor }}"
  20. position="{{ item.badge.position || 'top-right' }}"
  21. offsetX="{{ item.badge.offsetX || '-9px' }}"
  22. offsetY="{{ item.badge.offsetY || '0px' }}">
  23. <image-icon
  24. className="ant-tab-bar"
  25. image="{{ mixin.value === index ? item.activeIcon : item.icon }}" />
  26. </ant-badge>
  27. <block wx:else>
  28. <image-icon
  29. className="ant-tab-bar"
  30. image="{{ mixin.value === index ? item.activeIcon : item.icon }}" />
  31. </block>
  32. <view class="ant-tab-bar-text-wrap">
  33. <!-- display: inline -->
  34. <text class="ant-tab-bar-text">{{ item.text }}</text>
  35. </view>
  36. </view>
  37. </block>
  38. </view>
  39. </view>