index.wxml 711B

12345678910111213141516171819202122232425262728293031
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <view
  3. class="{{ utils.bem('tabbar-item', { active }) }} custom-class"
  4. style="color: {{ active ? activeColor : inactiveColor }}"
  5. bind:tap="onClick"
  6. >
  7. <view class="{{ utils.bem('tabbar-item__icon', { dot }) }}">
  8. <van-icon
  9. wx:if="{{ icon }}"
  10. name="{{ icon }}"
  11. customStyle="display: block"
  12. />
  13. <block wx:else>
  14. <slot
  15. wx:if="{{ active }}"
  16. name="icon-active"
  17. />
  18. <slot wx:else name="icon" />
  19. </block>
  20. <van-info
  21. wx:if="{{ info !== null }}"
  22. info="{{ info }}"
  23. custom-style="margin-top: 2px"
  24. />
  25. </view>
  26. <view class="van-tabbar-item__text">
  27. <slot />
  28. </view>
  29. </view>