tab-bar-item.wxml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <view
  2. class="{{classPrefix}} {{icon ? '' : prefix + '-is-bordered'}} {{split ? prefix + '-is-split' : ''}}"
  3. hover-class="{{classPrefix}}--active"
  4. hover-stay-time="{{200}}"
  5. >
  6. <view class="{{classPrefix}}__content {{isChecked ? prefix + '-is-checked' : ''}}" bindtap="toggle">
  7. <view class="{{classPrefix}}__icon" wx:if="{{icon}}">
  8. <t-badge
  9. wx:if="{{badgeProps.dot || badgeProps.count}}"
  10. count="{{badgeProps.count}}"
  11. max-count="{{badgeProps.maxCount || 99}}"
  12. dot="{{badgeProps.dot}}"
  13. content="{{badgeProps.content}}"
  14. size="{{badgeProps.size}}"
  15. visible="{{badgeProps.visible}}"
  16. offset="{{badgeProps.offset || [0,0]}}"
  17. t-class-count="{{prefix + '-badge-class'}}"
  18. >
  19. <t-icon name="{{icon}}" size="24px" />
  20. </t-badge>
  21. <t-icon wx:else name="{{icon}}" size="24px" />
  22. <slot name="icon" />
  23. </view>
  24. <view class="{{classPrefix}}__text {{icon ? prefix + '-size-s' : ''}}">
  25. <view class="{{classPrefix}}__icon-menu" wx:if="{{hasChildren}}" />
  26. <slot />
  27. </view>
  28. </view>
  29. <view class="{{classPrefix}}__spread" wx:if="{{hasChildren && isSpread}}">
  30. <view
  31. class="{{classPrefix}}__spread-item"
  32. hover-class="{{classPrefix}}__spread-item--active"
  33. hover-stay-time="{{200}}"
  34. wx:for="{{subTabBar}}"
  35. wx:for-item="child"
  36. wx:for-index="index"
  37. wx:key="index"
  38. bind:tap="selectChild"
  39. data-value="{{child.value || index}}"
  40. >{{ child.label }}
  41. </view>
  42. </view>
  43. </view>