index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="tmp-box">
  3. <view class='filterBox'>
  4. <view class='filter-input'>
  5. <text style="color: #b8b8b8;" class="iconfont icon-sousuo filterImg"/>
  6. <input class="text" type='text' v-model="inputVal" confirm-type="搜索" @confirm='handleFllter' placeholder='搜索'></input>
  7. </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. inputVal: "",
  16. };
  17. },
  18. methods: {
  19. handleFllter(e) {
  20. // console.log(e.detail.value)
  21. this.$emit("confirm", e.detail.value)
  22. },
  23. clears(){
  24. console.log(this.inputVal)
  25. this.inputVal=""
  26. console.log('清除了内容')
  27. }
  28. },
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .filterBox {
  33. padding: 15rpx 32rpx;
  34. background-color: #fff;
  35. .filter-input {
  36. height: 80rpx;
  37. background-color: #eeeff0;
  38. border-radius: 40rpx;
  39. display: flex;
  40. align-items: center;
  41. padding-left: 40rpx;
  42. .filterImg {
  43. width: 32rpx;
  44. height: 32rpx;
  45. margin-right: 20rpx;
  46. margin-bottom: 5rpx;
  47. }
  48. .filterImgs {
  49. width: 32rpx;
  50. height: 32rpx;
  51. }
  52. .text {
  53. width: 84%;
  54. background-color: #eeeff0;
  55. font-size: 32rpx;
  56. color: #000;
  57. }
  58. }
  59. }
  60. @import url("../css/icon.css");
  61. </style>