input.wxml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <view
  2. class="{{classPrefix}} {{!!errorMessage ? classBasePrefix + '-is-error' : ''}} {{classPrefix}}--size-{{size}} {{classPrefix + (borderless ? '' : '--bordered')}} {{prefix}}-class"
  3. >
  4. <view wx:if="{{prefixIcon}}" class="{{classPrefix}}__icon-wrap">
  5. <slot name="prefixIcon" wx:if="{{prefixIcon === 'slot'}}" />
  6. <t-icon wx:else class="{{classPrefix}}__icon--prefix {{prefix}}-class-icon" name="{{prefixIcon}}" />
  7. </view>
  8. <view wx:if="{{label}}" class="{{classPrefix}}__label">
  9. <slot name="label" wx:if="{{label === 'slot'}}" />
  10. <text wx:else class="{{prefix}}-class-label">{{label}}</text>
  11. </view>
  12. <view class="{{classPrefix}}__wrap">
  13. <view class="{{classPrefix}}__content">
  14. <input
  15. disabled="{{disabled}}"
  16. placeholder="{{placeholder}}"
  17. placeholderStyle="{{placeholderStyle}}"
  18. placeholder-class="{{classPrefix}}__placeholder"
  19. value="{{value}}"
  20. bindinput="onInput"
  21. bindfocus="onFocus"
  22. bindblur="onBlur"
  23. bindconfirm="onConfirm"
  24. bind:keyboardheightchange="onKeyboardHeightChange"
  25. password="{{type === 'password'}}"
  26. type="{{type === 'password' ? 'text' : type}}"
  27. focus="{{focus}}"
  28. confirm-type="{{confirmType}}"
  29. confirm-hold="{{confirmHold}}"
  30. cursor="{{cursor}}"
  31. cursor-spacing="{{cursorSpacing}}"
  32. adjust-position="{{adjustPosition}}"
  33. auto-focus="{{autoFocus}}"
  34. always-embed="{{alwaysEmbed}}"
  35. selection-start="{{selectionStart}}"
  36. selection-end="{{selectionEnd}}"
  37. hold-keyboard="{{holdKeyboard}}"
  38. safe-password-cert-path="{{safePasswordCertPath}}"
  39. safe-password-length="{{safePasswordLength}}"
  40. safe-password-time-stamp="{{safePasswordTimeStamp}}"
  41. safe-password-nonce="{{safePasswordNonce}}"
  42. safe-password-salt="{{safePasswordSalt}}"
  43. safe-password-custom-hash="{{safePasswordCustomHash}}"
  44. class="{{classPrefix}}__control {{suffix || align ==='right' ? classPrefix + '__control--right':''}} {{align === 'center' ? classPrefix + '__control--center':''}} {{prefix}}-class-input"
  45. />
  46. <view wx:if="{{ clearable && value.length > 0}}" class="{{classPrefix}}__wrap--icon" bind:tap="clearInput">
  47. <t-icon name="close-circle-filled" size="48rpx" class="{{prefix}}-class-clearable" />
  48. </view>
  49. <view class="{{classPrefix}}__wrap--suffix">
  50. <slot name="suffix" />
  51. </view>
  52. <view wx:if="{{suffix}}" class="{{classPrefix}}__wrap--suffix-text {{prefix}}-class-suffix">
  53. <text>{{suffix}}</text>
  54. </view>
  55. <view wx:if="{{suffixIcon}}" class="{{classPrefix}}__wrap--icon">
  56. <t-icon name="{{suffixIcon}}" size="48rpx" class="{{prefix}}-class-suffix-icon" />
  57. </view>
  58. </view>
  59. <view
  60. wx:if="{{errorMessage && errorMessage.length > 0}}"
  61. class="{{classPrefix}}__error-msg {{prefix}}-class-error-msg"
  62. >{{errorMessage}}
  63. </view>
  64. </view>
  65. </view>