问题描述:ios移动端输入内容,软键盘弹出,页面内容整体上移。但是键盘收起,页面内容不下滑。导致定位不正确,事件无法被触发;

解决方案:给点击事件控制滚动条

<input class="item-input" type="text" v-model="name" placeholder="请输入你的姓名" @blur="blurIn"/>

export default {    
  computed: {       
     scrollHeight () {           
       returndocument.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop || 0
    }
   }    
  methods: {        
    blurIn () {            
      window.scrollTo(0, Math.max(this.scrollHeight - 1, 0))        
    }   
   }
} 

 

相关文章:

  • 2022-12-23
  • 2021-08-11
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-20
  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
相关资源
相似解决方案