<template>
<view class="content" @click="setFocusInputs">
<input class="hide_input" @input="setScanInputs" type="text" :focus="focus" v-model="scanValue"
placeholder="扫一扫二维码" />
</view>
</template>
<style scoped>
.hide_input {
width: 1px;
height: 1px;
}
</style>
data() {
return {
focus:true,
scanValue:""
}
},
onLoad() {
setInterval(() => {
uni.hideKeyboard();
}, 50)
}
setFocusInputs() {
this.focus = false;
this.$nextTick(() => {
this.focus = true;
})
}
setScanInputs(e) {
console.log(e.detail.value)
}