index.axml 1.8 KB

1234567891011121314151617181920212223242526
  1. <view class='search-index {{className}}' style='{{style}}' ref='saveChildRef0'>
  2. <import-sjs from='../wxs/utils.sjs' name='utils'>
  3. </import-sjs>
  4. <view class="{{ utils.bem('search', { withaction: showAction || useActionSlot }) }} {{customClass}}" style='background: {{ background }}'>
  5. <view class="{{ utils.bem('search__content', [shape]) }}">
  6. <view class='van-search__label' a:if='{{ label }}'>
  7. {{ label }}
  8. </view>
  9. <slot a:else name='label'>
  10. </slot>
  11. <van-field type='search' left-icon="{{ !useLeftIconSlot ? leftIcon : '' }}" right-icon="{{ !useRightIconSlot ? rightIcon : '' }}" focus='{{ focus }}' error='{{ error }}' border='{{ false }}' confirm-type='search' class='van-search__field {{fieldClass}}' value='{{ value }}' disabled='{{ disabled }}' readonly='{{ readonly }}' clearable='{{ clearable }}' maxlength='{{ maxlength }}' input-align='{{ inputAlign }}' input-class='{{inputClass}}' placeholder='{{ placeholder }}' placeholder-style='{{ placeholderStyle }}' custom-style='padding: 5px 10px 5px 0; background-color: transparent;' onBlur='onBlur' onFocus='onFocus' onChange='onChange' onConfirm='onSearch' onClear='onClear' ref='saveChildRef1'>
  12. <slot a:if='{{ useLeftIconSlot }}' name='left-icon' slot='left-icon'>
  13. </slot>
  14. <slot a:if='{{ useRightIconSlot }}' name='right-icon' slot='right-icon'>
  15. </slot>
  16. </van-field>
  17. </view>
  18. <view a:if='{{ showAction || useActionSlot }}' class='van-search__action' hover-class='van-search__action--hover' hover-stay-time='70'>
  19. <slot a:if='{{ useActionSlot }}' name='action'>
  20. </slot>
  21. <view a:else class='{{cancelClass}}' onTap='antmoveAction' data-antmove-tap='onCancel'>
  22. {{ actionText }}
  23. </view>
  24. </view>
  25. </view>
  26. </view>