index.axml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <view
  2. class="ant-tab-bar {{className || ''}}"
  3. style="{style || ''}">
  4. <view class="ant-tab-bar-wrap">
  5. <view
  6. class="ant-tab-bar-item {{ index === mixin.value ? ('ant-tab-bar-item-active' + (activeClassName || '')) : '' }}"
  7. style="{{index === mixin.value ? (activeStyle||'') : ''}}"
  8. a:for="{{items}}"
  9. onTap="onChange"
  10. data-index="{{index}}">
  11. <badge
  12. a:if="{{item.badge}}"
  13. type="{{item.badge.type}}"
  14. text="{{item.badge.text}}"
  15. number="{{item.badge.number}}"
  16. stroke="{{item.badge.stroke}}"
  17. iconType="{{item.badge.iconType}}"
  18. bgColor="{{item.badge.bgColor}}"
  19. position="{{item.badge.position || 'top-right'}}"
  20. offsetX="{{item.badge.offsetX || '-9px'}}"
  21. offsetY="{{item.badge.offsetY || '0px'}}">
  22. <slot
  23. name="icon"
  24. active="{{mixin.value == index}}"
  25. item="{{item}}"
  26. index="{{index}}">
  27. <image-icon
  28. className="ant-tab-bar"
  29. image="{{mixin.value === index? item.activeIcon : item.icon}}" />
  30. </slot>
  31. </badge>
  32. <slot
  33. a:else
  34. name="icon"
  35. active="{{mixin.value == index}}"
  36. item="{{item}}"
  37. index="{{index}}">
  38. <image-icon
  39. className="ant-tab-bar"
  40. image="{{mixin.value === index?item.activeIcon : item.icon}}" />
  41. </slot>
  42. <view class="ant-tab-bar-text-wrap">
  43. <slot
  44. name="text"
  45. active="{{mixin.value === index}}"
  46. item="{{item}}"
  47. index="{{index}}">
  48. <text class="ant-tab-bar-text">{{item.text}}</text>
  49. </slot>
  50. </view>
  51. </view>
  52. </view>
  53. </view>