index.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="zs-search" :class="[fixed?'fixed':'']">
  3. <input class="input" :style="{lineHeight:height+'rpx',height:height+'rpx',borderRadius:height / 2+'px',color:color,background:bgColor}" :type="type" :value="value1" @input="input" />
  4. <!-- <u-icon class="search" name="search" color="#rgb(16, 16, 16)" size="88"></u-icon> -->
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. props: {
  10. type: {
  11. type: String,
  12. default: 'text'
  13. },
  14. height: {
  15. type: String,
  16. default: '90'
  17. },
  18. color: {
  19. type: String,
  20. default: '#606266'
  21. },
  22. bgColor:{
  23. type: String,
  24. default: '#efefef'
  25. },
  26. fixed:{
  27. type: Boolean,
  28. default: false
  29. },
  30. value:{
  31. }
  32. },
  33. data() {
  34. return {
  35. }
  36. },
  37. onReady(res) {
  38. },
  39. onLoad(){
  40. },
  41. computed: {
  42. value1() {
  43. return this.value
  44. }
  45. },
  46. methods: {
  47. input(val){
  48. this.$emit('input',val.detail.value )
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss">
  54. .zs-search{
  55. background: #fff;
  56. padding: 20rpx;
  57. box-sizing: border-box;
  58. top: 0%;
  59. left: 0;
  60. width: 100%;
  61. position: relative;
  62. .input{
  63. box-sizing: border-box;
  64. padding-left: 35rpx;
  65. }
  66. }
  67. .fixed{
  68. position: fixed !important;
  69. }
  70. </style>