From 4063b0e6e26380be76fb1aba9d42d2185e558003 Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Tue, 8 Nov 2022 17:49:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=AB=E7=A0=81=E9=94=AE=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchBox.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/SearchBox.vue b/src/components/SearchBox.vue index a27b609..49f258d 100644 --- a/src/components/SearchBox.vue +++ b/src/components/SearchBox.vue @@ -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', '')