2***@qq.com
2***@qq.com
  • 发布:2025-04-07 11:43
  • 更新:2025-04-07 14:17
  • 阅读:38

pda进入页面给input焦点,但是不要弹出软盘怎么设置

分类:HBuilderX

<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软盘还是能弹出

2025-04-07 11:43 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com (作者)

解决了,在input加一个inputmode="none"属性就可以了,如果是特定平台使用平台专用的禁止软盘事件例如
uni.hideKeyboard();
if(判断是安卓){
plus.key.hideSoftKeybord(); // 调用
}

要回复问题请先登录注册