index.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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: 14rpx;
  34. height: 90rpx;
  35. }
  36. .index-search {
  37. border-bottom: 0;
  38. background: #fff;
  39. border-radius: 50rpx;
  40. overflow: hidden;
  41. font-size: 28rpx;
  42. color: #6d6d6d;
  43. box-sizing: border-box;
  44. line-height: 64rpx;
  45. display: flex;
  46. align-items: center;
  47. .index-cont-search {
  48. width: 100%;
  49. font-size: 28rpx;
  50. background: #f7f7f7;
  51. display: flex;
  52. justify-content: center;
  53. align-items: center;
  54. }
  55. .index-cont-search .search-icon {
  56. font-size: 28rpx;
  57. }
  58. .index-cont-search .search-text {
  59. margin-left: 14rpx;
  60. }
  61. }
  62. </style>