index.wxml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <view
  2. class="ant-input {{ disabled ? 'ant-input-disabled' : '' }} {{ className ? className : '' }} {{ selfFocus ? (focusClassName ? focusClassName : '') : '' }}"
  3. style="{{ style || '' }};{{ focusStyle || '' }}">
  4. <view class="ant-input-prefix">
  5. <slot name="prefix">{{ prefix }}</slot>
  6. </view>
  7. <view class="ant-input-line">
  8. <input
  9. enableNative="{{ enableNative }}"
  10. name="{{ name }}"
  11. class="ant-input-content"
  12. disabled="{{ disabled }}"
  13. value="{{ state.value }}"
  14. type="{{ type }}"
  15. cursor-spacing="{{ cursorSpacing }}"
  16. always-embed="{{ alwaysEmbed }}"
  17. cursor-color="{{ cursorColor }}"
  18. adjust-position="{{ adjustPosition }}"
  19. hold-keyboard="{{ holdKeyboard }}"
  20. password="{{ password }}"
  21. placeholder="{{ placeholder }}"
  22. placeholder-class="ant-input-placeholder {{ placeholderClassName ? placeholderClassName : '' }}"
  23. placeholder-style="{{ placeholderStyle ? placeholderStyle : '' }}"
  24. maxlength="{{ maxLength }}"
  25. focus="{{ focus }}"
  26. confirm-type="{{ confirmType }}"
  27. confirm-hold="{{ confirmHold }}"
  28. always-system="{{ alwaysSystem }}"
  29. controlled="{{ state.controlled }}"
  30. cursor="{{ cursor }}"
  31. selection-start="{{ selectionStart }}"
  32. selection-end="{{ selectionEnd }}"
  33. random-number="{{ randomNumber }}"
  34. bindinput="onChange"
  35. bindconfirm="onConfirm"
  36. bindfocus="onFocus"
  37. bindblur="onBlur" />
  38. <view
  39. wx:if="{{ allowClear }}"
  40. class="ant-input-clear {{ state.value && state.value.length > 0 ? 'ant-input-clear-show' : 'ant-input-clear-hidden' }}"
  41. bind:tap="onClear">
  42. <icon
  43. className="ant-input-clear-icon"
  44. type="CloseCircleFill" />
  45. </view>
  46. </view>
  47. <view class="ant-input-suffix">
  48. <slot name="suffix">{{ suffix }}</slot>
  49. </view>
  50. </view>