side-bar-item.wxml 854 B

1234567891011121314151617181920212223
  1. <import src="../common/template/badge" />
  2. <import src="../common/template/icon" />
  3. <wxs src="../common/utils.wxs" module="_" />
  4. <view
  5. class="{{_.cls(classPrefix, [['active', active], ['disabled', disabled]])}} {{prefix}}-class"
  6. style="{{_._style([style, customStyle])}}"
  7. bind:tap="handleClick"
  8. aria-role="button"
  9. aria-label="{{ active ? '已选中' + label : label}}"
  10. aria-disabled="{{disabled}}"
  11. >
  12. <block wx:if="{{active}}">
  13. <view class="{{classPrefix}}__line"></view>
  14. <view class="{{classPrefix}}__prefix"></view>
  15. <view class="{{classPrefix}}__suffix"></view>
  16. </block>
  17. <template wx:if="{{_icon}}" is="icon" data="{{ class: classPrefix + '__icon', ..._icon }}" />
  18. <block wx:if="{{badgeProps}}">
  19. <template is="badge" data="{{ ...badgeProps, content: label }}" />
  20. </block>
  21. <block wx:else>{{label}}</block>
  22. </view>