index.wxml 1.1 KB

123456789101112131415
  1. <label class="wux-class wux-checkbox {{ inputChecked ? 'wux-checkbox--checked' : '' }} {{ disabled ? 'wux-checkbox--disabled' : '' }}" bindtap="onChange" style="{{ wrapStyle }}">
  2. <block wx:if="{{ type === 'checkbox' }}">
  3. <checkbox value="{{ value }}" checked="{{ inputChecked }}" color="{{ inputColor }}" disabled="{{ disabled }}" class="wux-input-class wux-checkbox__input" />
  4. <icon class="wux-checkbox__icon" type="{{ inputChecked ? 'success' : 'circle' }}" size="23" color="{{ !disabled ? inputColor : '#666' }}" />
  5. </block>
  6. <block wx:elif="{{ type === 'radio' }}">
  7. <radio value="{{ value }}" checked="{{ inputChecked }}" color="{{ inputColor }}" disabled="{{ disabled }}" class="wux-input-class wux-checkbox__input" />
  8. <icon class="wux-checkbox__icon" type="success_no_circle" size="16" color="{{ !disabled ? inputColor : '#666' }}" hidden="{{ !inputChecked }}" />
  9. </block>
  10. <block wx:else>
  11. <slot name="icon-on" wx:if="{{ inputChecked }}"></slot>
  12. <slot name="icon-off" wx:else></slot>
  13. </block>
  14. <slot></slot>
  15. </label>