search.wxml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <wxs src="../common/utils.wxs" module="_" />
  2. <view style="{{_._style([style, customStyle])}}" class="class {{classPrefix}} {{prefix}}-class">
  3. <view
  4. class="{{classPrefix}}__input-box {{prefix}}-{{localValue.focus ? 'is-focused' : 'not-focused'}} {{classPrefix}}__input-box--{{center ? 'center' : ''}} {{classPrefix}}__input-box--{{shape}} {{prefix}}-class-input-container"
  5. >
  6. <!-- <view wx:if="{{label}}" class="{{classPrefix}}__label {{prefix}}-class-label">{{label}}</view>
  7. <slot name="label" /> -->
  8. <t-icon
  9. wx:if="{{leftIcon}}"
  10. name="{{leftIcon}}"
  11. size="24"
  12. class="{{prefix}}-icon {{prefix}}-class-left"
  13. aria-hidden="{{true}}"
  14. />
  15. <slot name="left-icon" />
  16. <input
  17. type="text"
  18. name="input"
  19. disabled="{{disabled}}"
  20. class="{{prefix}}-input__keyword {{prefix}}-class-input"
  21. focus="{{localValue.focus}}"
  22. value="{{value}}"
  23. confirm-type="search"
  24. placeholder="{{placeholder}}"
  25. placeholder-class="{{classPrefix}}__placeholder {{classPrefix}}__placeholder--{{center ? 'center': 'normal'}}"
  26. bind:input="onInput"
  27. bind:focus="onFocus"
  28. bind:blur="onBlur"
  29. bind:confirm="onConfirm"
  30. />
  31. <view
  32. wx:if="{{value !==''}}"
  33. class="{{classPrefix}}__right {{prefix}}-class-right"
  34. bind:tap="handleClear"
  35. aria-role="button"
  36. aria-label="清除"
  37. >
  38. <t-icon
  39. wx:if="{{rightIcon}}"
  40. name="{{rightIcon}}"
  41. class="{{prefix}}-icon"
  42. size="18px"
  43. color="rgba(187,187,187,1)"
  44. />
  45. <slot name="right-icon" />
  46. </view>
  47. </view>
  48. <view
  49. wx:if="{{action}}"
  50. class="{{classPrefix}}__search-action {{prefix}}-class-action"
  51. bindtap="onActionClick"
  52. aria-role="button"
  53. >
  54. {{action}}
  55. </view>
  56. <slot name="action" />
  57. </view>