index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="search adfac">
  3. <image class="icon" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/19/d568b395-8490-4e44-af30-7fb5288b8bad.png"></image>
  4. <div class="input">
  5. <up-input :placeholder="placeholder" v-model="keyword" border="none" style="font-size: 26rpx;"></up-input>
  6. </div>
  7. <div class="btn" @tap="handleSearch">搜索</div>
  8. </view>
  9. </template>
  10. <script setup name="CusSearch">
  11. defineProps({
  12. placeholder:{
  13. typeof: String,
  14. default: '查找公益活动'
  15. }
  16. })
  17. import { ref } from 'vue'
  18. const keyword = ref('')
  19. const emits = defineEmits(['handleSearch'])
  20. const handleSearch = () => {
  21. emits('handleSearch',keyword.value);
  22. }
  23. </script>
  24. <style scoped lang="scss">
  25. .search{
  26. width: 100%;
  27. background: #FFFFFF;
  28. border-radius: 34rpx;
  29. padding: 6rpx 6rpx 6rpx 26rpx;
  30. box-sizing: border-box;
  31. .icon{
  32. width: 36rpx;
  33. height: 36rpx;
  34. }
  35. .input{
  36. flex: 1;
  37. padding: 0 11rpx;
  38. box-sizing: border-box;
  39. }
  40. .btn{
  41. padding: 9rpx 27rpx;
  42. background: #B7F358;
  43. border-radius: 34rpx;
  44. font-family: PingFangSC, PingFang SC;
  45. font-weight: 400;
  46. font-size: 26rpx;
  47. color: #252525;
  48. line-height: 37rpx;
  49. }
  50. }
  51. </style>