index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <!-- 搜索框 -->
  3. <view class="search-wrapper">
  4. <view class="index-search" @click="onClick">
  5. <view class="index-cont-search t-c">
  6. <text class="search-icon iconfont icon-search"></text>
  7. <text class="search-text">{{ tips }}</text>
  8. </view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. props: {
  15. tips: {
  16. type: String,
  17. default: '搜索商品'
  18. }
  19. },
  20. data() {
  21. return {}
  22. },
  23. methods: {
  24. onClick() {
  25. this.$emit('event')
  26. }
  27. }
  28. }
  29. </script>
  30. <style lang="scss" scoped>
  31. .search-wrapper {
  32. background: #fff;
  33. padding: 13rpx;
  34. }
  35. .index-search {
  36. border-bottom: 0;
  37. background: #fff;
  38. border-radius: 50rpx;
  39. overflow: hidden;
  40. font-size: 28rpx;
  41. color: #6d6d6d;
  42. box-sizing: border-box;
  43. height: 64rpx;
  44. line-height: 64rpx;
  45. .index-cont-search {
  46. width: 100%;
  47. font-size: 28rpx;
  48. background: #f7f7f7;
  49. display: flex;
  50. justify-content: center;
  51. align-items: center;
  52. }
  53. .index-cont-search .search-icon {
  54. font-size: 28rpx;
  55. }
  56. .index-cont-search .search-text {
  57. margin-left: 14rpx;
  58. }
  59. }
  60. </style>