<template>
<input
class="scan-input"
type="text"
v-model="berthNoScan"
:focus="berth.focusState"
@focus="handleFocus"
inputmode="none"
@blur="handleBerthBlur"
/>
</template>
<script>
data() {
return {
berth: {
start: -1,
end: -1,
focusState: false , // 默认聚焦Berth扫描
errorMsg: ''
}
};
},
mounted() {
this.berth.focusState = true;
},
methods: {
handleFocus() {
uni.hideKeyboard();
},
</script>
进入页面软盘还是会闪现一下,而且快速点击input软盘还是能弹出
1 个回复
2***@qq.com (作者)
解决了,在input加一个inputmode="none"属性就可以了,如果是特定平台使用平台专用的禁止软盘事件例如
uni.hideKeyboard();
if(判断是安卓){
plus.key.hideSoftKeybord(); // 调用
}