headerInput.vue 764 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view class="container">
  3. <uni-icons type="search" size="24" color="#808080"></uni-icons>
  4. <input class="input" type="text" placeholder="请输入关键词" placeholder-style="color:#CCCCCC;font-size:28rpx" @input="handleInput" />
  5. </view>
  6. </template>
  7. <script setup>
  8. const $emit = defineEmits(['changeInputValue'])
  9. const handleInput = (e) => {
  10. $emit('changeInputValue', e.detail.value)
  11. }
  12. </script>
  13. <style lang="scss" scoped>
  14. .container {
  15. position: relative;
  16. display: flex;
  17. align-items: center;
  18. box-sizing: border-box;
  19. padding: 0 40rpx;
  20. margin-top: 30rpx;
  21. width: 710rpx;
  22. height: 100rpx;
  23. border-radius: 80rpx;
  24. border: 1rpx solid #ccc;
  25. background-color: #fff;
  26. .input {
  27. margin-left: 16rpx;
  28. width: 100%;
  29. height: 100%;
  30. }
  31. }
  32. </style>