index.axml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <view class='field-index {{className}}' style='{{style}}' ref='saveChildRef0'>
  2. <import-sjs from='./index.sjs' name='computed'>
  3. </import-sjs>
  4. <import-sjs from='../wxs/utils.sjs' name='utils'>
  5. </import-sjs>
  6. <van-cell size='{{ size }}' icon='{{ leftIcon }}' center='{{ center }}' border='{{ border }}' is-link='{{ isLink }}' required='{{ required }}' clickable='{{ clickable }}' title-width='{{ titleWidth }}' title-style='margin-right: 12px;' custom-style='{{ customStyle }}' arrow-direction='{{ arrowDirection }}' custom-class='van-field' ref='saveChildRef1'>
  7. <slot name='left-icon' slot='icon'>
  8. </slot>
  9. <view a:if='{{ label }}' class="{{labelClass}} {{ utils.bem('field__label', { disabled }) }}" slot='title'>
  10. {{ label }}
  11. </view>
  12. <slot a:else name='label' slot='title'>
  13. </slot>
  14. <view class="{{ utils.bem('field__body', [type]) }}">
  15. <textarea a:if="{{ type === 'textarea' }}" class="{{inputClass}} {{ utils.bem('field__input', [inputAlign, type, { disabled, error }]) }}" focus='{{ autoFocus }}' value='{{ innerValue }}' disabled='{{ disabled || readonly }}' maxlength='{{ maxlength }}' placeholder='{{ placeholder }}' placeholder-style='{{ placeholderStyle }}' placeholder-class="{{ utils.bem('field__placeholder', { error, disabled }) }}" auto-height='{{ !!autosize }}' style='{{ computed.inputStyle(autosize) }}' undefined='onLineChange' onFocus='onFocus' onBlur='onBlur' onConfirm='onConfirm' onInput='onInput'>
  16. </textarea>
  17. <custom-input a:else class="{{inputClass}} {{ utils.bem('field__input', [inputAlign, { disabled, error }]) }}" type="{{ type === 'search' ? 'text' : type}}" focus='{{ focus }}' cursor='{{ cursor }}' value='{{ innerValue }}' auto-focus='{{ autoFocus }}' disabled='{{ disabled || readonly }}' maxlength='{{ maxlength }}' placeholder='{{ placeholder }}' placeholder-style='{{ placeholderStyle }}' placeholder-class="{{ utils.bem('field__placeholder', { error }) }}" confirm-type='{{ confirmType }}' confirm-hold='{{ confirmHold }}' selection-end='{{ selectionEnd }}' selection-start='{{ selectionStart }}' password="{{ password || type === 'password' }}" onInput='onInput' onBlur='onBlur' onFocus='onFocus' onConfirm='onConfirm'>
  18. </custom-input>
  19. <van-icon hidden='{{ showClear }}' name='clear' class='van-field__clear-root van-field__icon-root' onClick='onClear' ref='saveChildRef2'>
  20. </van-icon>
  21. <view class='van-field__icon-container' onTap='antmoveAction' data-antmove-tap='onClickIcon'>
  22. <van-icon a:if='{{ rightIcon || icon }}' name='{{ rightIcon || icon }}' class='van-field__icon-root {{ iconClass }}' custom-class='{{rightIconClass}}' ref='saveChildRef3'>
  23. </van-icon>
  24. <slot name='right-icon'>
  25. </slot>
  26. <slot name='icon'>
  27. </slot>
  28. </view>
  29. <view class='van-field__button'>
  30. <slot name='button'>
  31. </slot>
  32. </view>
  33. </view>
  34. <view a:if='{{ showWordLimit && maxlength }}' class='van-field__word-limit'>
  35. <view class="{{ utils.bem('field__word-num', { full: value.length >= maxlength }) }}">
  36. {{ value.length }}
  37. </view>
  38. /{{ maxlength }}
  39. </view>
  40. <view a:if='{{ errorMessage }}' class="{{ utils.bem('field__error-message', [errorMessageAlign, { disabled, error }]) }}">
  41. {{ errorMessage }}
  42. </view>
  43. </van-cell>
  44. </view>