uniapp中input框聚焦

时间: 2023-11-14 admin 维修知识

uniapp中input框聚焦

uniapp中input框聚焦

在需要聚焦的方法内写入

this.Focus = true;
// 获取软键盘的高度
uni.onKeyboardHeightChange(res => {console.log(res.height);if (res.height === 0) {this.Focus = false;
}
})

然后在失去焦点的时候

this.Focus = false;