index.wxml 1.1 KB

1234567891011121314151617181920212223242526272829
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <view class="van-radio custom-class">
  3. <view
  4. wx:if="{{ labelPosition === 'left' }}"
  5. class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
  6. bindtap="onClickLabel"
  7. >
  8. <slot />
  9. </view>
  10. <view class="van-radio__icon-wrap" style="font-size: {{ utils.addUnit(iconSize) }};" bindtap="onChange">
  11. <slot wx:if="{{ useIconSlot }}" name="icon" />
  12. <van-icon
  13. wx:else
  14. name="success"
  15. class="{{ utils.bem('radio__icon', [shape, { disabled, checked: value === name }]) }}"
  16. style="font-size: {{ utils.addUnit(iconSize) }};{{ checkedColor && !disabled && value === name ? 'border-color:' + checkedColor + '; background-color:' + checkedColor + ';' : '' }}"
  17. custom-class="icon-class"
  18. custom-style="line-height: {{ utils.addUnit(iconSize) }};font-size: .8em;display: block;"
  19. />
  20. </view>
  21. <view
  22. wx:if="{{ labelPosition === 'right' }}"
  23. class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
  24. bindtap="onClickLabel"
  25. >
  26. <slot />
  27. </view>
  28. </view>