index.wxml 668 B

123456789101112131415
  1. <view
  2. class="ant-switch {{ className ? className : '' }} ant-switch-{{ size }} {{ mixin.value ? 'ant-switch-checked' : '' }} {{ disabled ? 'ant-switch-disabled' : '' }} {{ loading ? 'ant-switch-loading' : '' }}"
  3. style="{{ mixin.value && color ? 'background:' + color + '; border-color:' + color : '' }};{{ style || '' }}"
  4. bind:tap="onChange">
  5. <view class="ant-switch-handle">
  6. <ant-icon
  7. wx:if="{{ loading }}"
  8. type="UndoOutline"
  9. className="ant-switch-loading-icon" />
  10. </view>
  11. <view class="ant-switch-inner">
  12. <block wx:if="{{ mixin.value }}">{{ checkedText }}</block>
  13. <block wx:else>{{ uncheckedText }}</block>
  14. </view>
  15. </view>