扫码键盘

This commit is contained in:
2022-11-08 17:49:12 +08:00
parent f05b6a55f4
commit 4063b0e6e2

View File

@@ -8,6 +8,7 @@
ref="scaninput"
:placeholder="keyCode === '' ? placeholder : keyCode"
:disabled="disabled"
:readOnly="readOnly"
:value="value"
@focus="handleFocus($event)"
@blur="handleBlur($event)"
@@ -66,7 +67,8 @@ export default {
return {
placeholder: '',
type: '',
cur: ''
cur: '',
readOnly: false
}
},
mounted () {
@@ -75,6 +77,10 @@ export default {
methods: {
handleScan () {
this.$refs.scaninput.focus()
this.readOnly = true
setTimeout(() => {
this.readOnly = false
}, 200)
this.placeholder = '请扫码键输入'
this.type = true
this.$emit('input', '')