/* 使文本框出现在视图区域 */
Vue.prototype.$gotoView = (event, position = ‘end’) => {
let This = event.currentTarget;
setTimeout(() => {
if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
This.scrollIntoViewIfNeeded(true);
} else {
This.scrollIntoView({block: position, inline: ‘nearest’});
}
}, 500);
},
/* 失去焦点,页面强制滚到顶部 */
Vue.prototype.$inputBlur = (top = 0) => {
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
window.scroll(0, top);
}
};