element-ui移动端时间组件隐藏虚拟键盘
在el-date-picker中新增@focus="forbid"方法,通过forbid触发屏蔽虚拟键盘。代码如下:
<el-date-picker
v-model="dateTime"
type="daterange"
align="right"
unlink-panels
range-separator="至"
:start-placeholder="startDate"
:end-placeholder="endDate"
:picker-options="pickerOptions"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
@focus="forbid"
></el-date-picker>
//方法
methods: {
//禁止软键盘弹出
forbid() {
document.activeElement.blur();
},
}
以上是编程学习网小编为您介绍的“element-ui移动端时间组件隐藏虚拟键盘”的全面内容,想了解更多关于 vuejs 内容,请继续关注编程基础学习网。