You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.0 KiB

10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="searchBg">
  3. <view class="flex">
  4. <view class="searchIcon">
  5. <image src="@/static/images/icon (19).png" mode=""></image>
  6. </view>
  7. <view class="inputBox">
  8. <u-search :placeholder="placeholder" v-model="keyword" :color="'#333'" :placeholder-color="'#B3B3B3'" :bgColor="'transparent'" :showAction="false" @search="$u.debounce(searchFn, 500)" @clear="searchFn"></u-search>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. props: ['placeholder'],
  16. data() {
  17. return {
  18. keyword: ''
  19. }
  20. },
  21. methods: {
  22. searchFn() {
  23. this.$emit('searchFn', this.keyword)
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. .searchBg {
  30. background: #f4f4f4;
  31. width: 100%;
  32. height: 72rpx;
  33. border-radius: 36rpx;
  34. line-height: 72rpx;
  35. border: 1px solid rgba(223, 223, 223, 0.4);;
  36. .flex {
  37. height: 100%;
  38. padding: 0 28rpx;
  39. .searchIcon {
  40. width: 40rpx;
  41. height: 36rpx;
  42. }
  43. .inputBox {
  44. flex: 1;
  45. // color: #fff;
  46. font-size: 28rpx;
  47. }
  48. }
  49. }
  50. </style>