index.wxml 1.1 KB

123456789101112131415161718192021222324252627282930
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <wxs src="./index.wxs" module="computed" />
  3. <view class="{{ utils.bem('radio', [direction]) }} custom-class">
  4. <view
  5. wx:if="{{ labelPosition === 'left' }}"
  6. class="{{ utils.bem('radio__label', [labelPosition, { disabled: disabled || parentDisabled }]) }} label-class"
  7. bindtap="onClickLabel"
  8. >
  9. <slot />
  10. </view>
  11. <view class="van-radio__icon-wrap" style="font-size: {{ utils.addUnit(iconSize) }}" bindtap="onChange">
  12. <slot wx:if="{{ useIconSlot }}" name="icon" />
  13. <van-icon
  14. wx:else
  15. name="success"
  16. class="{{ utils.bem('radio__icon', [shape, { disabled: disabled || parentDisabled, checked: value === name }]) }}"
  17. style="{{ computed.iconStyle({ iconSize, checkedColor, disabled, parentDisabled, value, name }) }}"
  18. custom-class="icon-class"
  19. custom-style="{{ computed.iconCustomStyle({ iconSize }) }}"
  20. />
  21. </view>
  22. <view
  23. wx:if="{{ labelPosition === 'right' }}"
  24. class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
  25. bindtap="onClickLabel"
  26. >
  27. <slot />
  28. </view>
  29. </view>