// 键盘问题
this.bodyHeight = document.documentElement.clientHeight
let timer = null
document.body.addEventListener('focusin', (e) => { // 软键盘弹起事件
if (timer && e.target.type !== 'button') {
clearTimeout(timer)
timer = null
}
})
document.body.addEventListener('focusout', (e) => {
if (e.target.type === 'password') {
timer = setTimeout(() => {
clearTimeout(timer)
timer = null
const nowH = document.documentElement.clientHeight
console.log('timeout', nowH, this.bodyHeight)
if (nowH < this.bodyHeight) {
const oinput = document.createElement('input')
oinput.style.width = '0px'
document.body.appendChild(oinput)
oinput.focus()
oinput.blur()
document.body.removeChild(oinput)
}
}, 500)
}
}) // 软键盘关闭事件