index.vue 1.3 KB

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