欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue實現(xiàn)移動端彈出鍵盤功能(防止頁面fixed布局錯亂)

 更新時間:2022年04月28日 15:38:17   作者:ssh__F  
這篇文章主要介紹了vue?解決移動端彈出鍵盤導致頁面fixed布局錯亂的問題,通過實例代碼給大家分享解決方案,對vue?移動端彈出鍵盤相關知識感興趣的朋友一起看看吧

監(jiān)聽頁面高度,當鍵盤彈出時,將按鈕隱藏。

data() {
  return {
    docmHeight: document.documentElement.clientHeight ||document.body.clientHeight,
    showHeight: document.documentElement.clientHeight ||document.body.clientHeight,
    hideshow:true //顯示或者隱藏footer
  }
 },
watch: {
    //監(jiān)聽顯示高度
   showHeight:function() {
     if(this.docmHeight > this.showHeight){
      //隱藏
       this.hideshow=false
     }else{
      //顯示
       this.hideshow=true
     }
   }
 },
mounted() {
   //監(jiān)聽事件
   window.onresize = ()=>{
     return(()=>{
       this.showHeight = document.documentElement.clientHeight || document.body.clientHeight;
   })()
   }
  
 },
<div class="bottom" v-show="hideshow">
  <div class="btn">
   <button>確認</button>
   <button>取消</button>
  </div>
 </div>

到此這篇關于vue 解決移動端彈出鍵盤導致頁面fixed布局錯亂的問題(推薦)的文章就介紹到這了,更多相關vue 移動端彈出鍵盤內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

最新評論