2021-01-12 18:04:14 +08:00

18 lines
1.1 KiB
Plaintext

<!---------- wxs start ----------->
<wxs module="utils" src="../wxs/utils.wxs"></wxs>
<!---------- wxs end ----------->
<view class="van-radio custom-class">
<view wx:if="{{ labelPosition === 'left' }}" class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}" bindtap="onClickLabel">
<slot></slot>
</view>
<view class="van-radio__icon-wrap" style="font-size: {{ utils.addUnit(iconSize) }};" bindtap="onChange">
<slot wx:if="{{ useIconSlot }}" name="icon"></slot>
<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;"></van-icon>
</view>
<view wx:if="{{ labelPosition === 'right' }}" class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}" bindtap="onClickLabel">
<slot></slot>
</view>
</view>