我是靠谱客的博主 大方大叔,这篇文章主要介绍PDA采用uniapp输入框实现连续扫描,现在分享给大家,希望可以做个参考。

uniapp的输入框的focus光标自动聚焦:

this.focus = false;
this.$nextTick(() => {
	this.focus = true;
	});

但在focus实现后,输入框里内容置空后console是空的,但是,框中内容还在,无法自动清除,

没办法就直接用定时了

setTimeout(() => {
that.value = ''
}, 100) 

所以,综上所述,PDA实现连续扫描全部代码:

<input class="input" v-model="value" :placeholder="placeholder" :disabled="disabled":focus="focus" :type="type" @input="onInput" @confirm="confirm" /> 

//JS
confirm: function(event) {
let that = this
that.value = ''
setTimeout(() => {
that.focus = false;
that.$nextTick(() => {
that.focus = true;
});
that.value = ''
}, 100)    
},

最后

以上就是大方大叔最近收集整理的关于PDA采用uniapp输入框实现连续扫描的全部内容,更多相关PDA采用uniapp输入框实现连续扫描内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(127)

评论列表共有 0 条评论

立即
投稿
返回
顶部