vue ios page in the pop-up soft keyboard input input leads to inaccurate positioning

Problem Description: ios mobile terminal input, the soft keyboard pops up, move the whole page content. But put away the keyboard, the page content does not decline. Resulting in incorrect positioning, the event can not be triggered;

Solution: Click on an event-controlled scroll bar

<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))        
    }   
   }
} 

 

Guess you like

Origin www.cnblogs.com/litterjoan/p/11803264.html