mt-field,ios
<mt-field class=“borderBottom borderTop” label=“手机号” placeholder=“请输入手机号” type=“tel” v-model=“formData.phone” @blur.native.capture=“scoll”>
@blur.native.capture="scoll"是mt-filed的失去焦点时触发的事件。
scoll() {
let ua = window.navigator.userAgent;
//获取端口机型
let app = window.navigator.appVersion;
if(!!ua.match(/(i[^;]+;( U;)? CPU.+Mac OS X/)){
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);
}else if(ua.indexOf(‘Android’) > -1 || ua.indexOf(‘Adr’) > -1) {
}
}**