index.axml 752 B

12345678910111213141516171819
  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. onTap="onChange">
  5. <view class="ant-switch-handle">
  6. <ant-icon
  7. a:if="{{ loading }}"
  8. type="UndoOutline"
  9. className="ant-switch-loading-icon" />
  10. </view>
  11. <view class="ant-switch-inner">
  12. <block a:if="{{ mixin.value }}">
  13. <slot name="checkedText">{{ checkedText }}</slot>
  14. </block>
  15. <block a:else>
  16. <slot name="uncheckedText">{{ uncheckedText }}</slot>
  17. </block>
  18. </view>
  19. </view>