网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網(wǎng)

微信小程序輸入框上移問題解決

發(fā)布時(shí)間:2021-06-25 10:47 所屬欄目:小程序開發(fā)教程

微信小程序的輸入框在上面還好,如果不是,在聚焦的時(shí)候頁(yè)面就會(huì)上移,上方的頁(yè)面信息會(huì)

inputFocus (e) {
  this.setData({bottom: e.detail.height})
},
inputBlur () {
  this.setData({bottom: 0})
}

看不到,影響用戶操作

在這里可以手動(dòng)設(shè)置并獲取輸入框的高度來解決

這種方式雖然有的機(jī)子有點(diǎn)卡,但是已經(jīng)算是比較完美的解決方案了

頁(yè)面部分
 

<view class="page-bottom" style="bottom:{{bottom}}px">
 <view class="block input-box">
      <view class="block-left">
        <input bindconfirm="toSubmit"
          value="{{code}}"
          bindfocus="inputFocus"
          bindblur="inputBlur"
          focus
          adjust-position="{{false}}"
          class="block-main"
          type="text"
          placeholder="手動(dòng)輸入"
          confirm-type="go"
          cursor-spacing="100"></input>
      </view>
    </view>
  </view>

js部分



易優(yōu)小程序(企業(yè)版)+靈活api+前后代碼開源 碼云倉(cāng)庫(kù):starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/26735.html 復(fù)制鏈接 如需定制請(qǐng)聯(lián)系易優(yōu)客服咨詢:800182392 點(diǎn)擊咨詢
QQ在線咨詢
AI智能客服 ×