MSearch.vue 910 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <div>
  3. <van-search placeholder="请输入搜索关键词"
  4. background="#fff"
  5. shape="round"
  6. @search="onSearch"
  7. show-action v-model="searchValue">
  8. <div slot="action" @click="onSearch">搜索</div>
  9. </van-search>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. props:['background'],
  15. data() {
  16. return {
  17. searchValue: "",
  18. color:'#fff'
  19. };
  20. },
  21. mounted(){
  22. },
  23. methods: {
  24. onSearch() {
  25. this.$emit("onSearch", this.searchValue);
  26. }
  27. }
  28. };
  29. </script>
  30. <style lang="less" scope>
  31. @import url("../assets/commonLess/variable.less");
  32. .squrt {
  33. width: 0.14rem;
  34. height: 0.12rem;
  35. margin-left: 0.1rem;
  36. }
  37. .van-search {
  38. padding: 0.13rem 0.16rem;
  39. }
  40. /deep/.van-search__action {
  41. color: @tFontColor;
  42. }
  43. .van-icon-search {
  44. color: @mColor;
  45. }
  46. </style>