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