移动端 提交按钮呗软键盘挤上去的问题解决
data() {
return {
docmHeight: document.documentElement.clientHeight,
showHeight: document.documentElement.clientHeight,
hideClass: false,
}
},
methods{
// 检测屏幕高度变化
inputType() {
if (!this.timer) {
this.timer = true
const that = this
setTimeout(() => {
if (that.docmHeight > that.showHeight) {
// 显示class
this.hideClass = true
} else if (that.docmHeight <= that.showHeight) {
// 显示隐藏
this.hideClass = false
}
that.timer = false
}, 20)
}
},
}
mounted() {
// window.onresize监听页面高度的变化
window.onresize = () => (() => {
window.screenHeight = document.body.clientHeight
this.showHeight = window.screenHeight
})()
},
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步