【组件】微信小程序input搜索框的实现

开发小程序的过程,是一个学习知识,解决问题的过程,每当实现了一个需求,总会有很大的成就感,每天记录一个开发过程中的细节。
实现效果如下:

【组件】微信小程序input搜索框的实现_第1张图片
图片.png

官方参考链接:https://developers.weixin.qq.com/miniprogram/dev/component/input.html

wxml:

    
        
          
            
            
          
        
      搜索  
      

wxss:

    .search{  
      width: 80%;  
    }  
    .search_arr {  
      border: 1px solid #d0d0d0;  
      border-radius: 10rpx;  
      margin-left: 20rpx;  
    }  
    .search_arr input{  
      margin-left: 60rpx;  
      height: 60rpx;  
      border-radius: 5px;  
    }  
    .bc_text {  
      line-height: 68rpx;  
      height: 68rpx;  
      margin-top: 34rpx;  
    }  
      
    .sousuo {  
      margin-left: 15rpx;  
      width: 15%;  
      line-height: 150%;  
      text-align: center;  
      border: 1px solid #d0d0d0;  
      border-radius: 10rpx;  
    }  
    .page_row{  
      display: flex;  
      flex-direction: row  
    }  
    .searchcion {  
      margin: 10rpx 10rpx 10rpx 10rpx;  
      position: absolute;  
      left:25rpx;  
      z-index: 2;  
      width: 20px;  
      height: 20px;  
      text-align: center;  
    }  

js:

//input.js
Page({
  data: {
    focus: false,
    inputValue: ''
  },
  bindButtonTap: function () {
    this.setData({
      focus: true
    })
  },
 
})

原文作者:祈澈姑娘:技术博客:https://www.jianshu.com/u/05f416aefbe1
90后前端妹子,爱编程,爱运营,爱折腾。 坚持总结工作中遇到的技术问题,坚持记录工作中所所思所见,欢迎大家一起探讨交流。

你可能感兴趣的:(【组件】微信小程序input搜索框的实现)