1.写个js即可(对于vue项目,将js写在mounted即可)
// 处理安卓手机输入法遮挡输入框问题
if ((/Android/gi).test(navigator.userAgent)) {
window.addEventListener('resize', function () {
if (document.activeElement.tagName == 'INPUT' ||
document.activeElement.tagName == 'TEXTAREA') {
window.setTimeout(function () {
document.activeElement.scrollIntoViewIfNeeded();
}, 0);
}
});
}
写上这段js 点击input 会自动将input显示在可视区域