// 解决唤起键盘后焦点定位错位的情况 使用方式@blur='blurhandler' blurhandler(){ let ua = window.navigator.userAgent; if(!!ua.match(/(i[^;]+;( U;)? CPU.+Mac OS X/)){ // ios 端 var currentPosition,timer; var speed=1; timer=setInterval(function(){ currentPosition=document.documentElement.scrollTop || document.body.scrollTop; currentPosition-=speed; window.scrollTo(0,currentPosition);//页面向上滚动 // currentPosition+=speed; // window.scrollTo(0,currentPosition);//页面向下滚动 clearInterval(timer); },100); } },