index.wxml 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <wxs src="./index.wxs" module="computed" />
  3. <view class="{{ utils.bem('checkbox', [{ horizontal: direction === 'horizontal' }]) }} custom-class">
  4. <view
  5. wx:if="{{ labelPosition === 'left' }}"
  6. class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
  7. bindtap="onClickLabel"
  8. >
  9. <slot />
  10. </view>
  11. <view class="van-checkbox__icon-wrap" bindtap="toggle">
  12. <slot wx:if="{{ useIconSlot }}" name="icon" />
  13. <van-icon
  14. wx:else
  15. name="success"
  16. size="0.8em"
  17. class="{{ utils.bem('checkbox__icon', [shape, { disabled: disabled || parentDisabled, checked: value }]) }}"
  18. style="{{ computed.iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) }}"
  19. custom-class="icon-class"
  20. custom-style="line-height: 1.25em;"
  21. />
  22. </view>
  23. <view
  24. wx:if="{{ labelPosition === 'right' }}"
  25. class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
  26. bindtap="onClickLabel"
  27. >
  28. <slot />
  29. </view>
  30. </view>