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