Skip to content

Commit 11fb809

Browse files
committed
fix:keyboard double input
1 parent 7ea84f0 commit 11fb809

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

templates/index.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<el-row v-if="pageNum === 0" class="qu" style="width:400px;margin: 6vh auto 0 auto">
3838
<el-card style="padding-bottom: 1rem">
3939
<el-col :span="24">
40-
<el-input autofocus @input="listenInput" clearable v-model:value="code" maxlength="5"
40+
<el-input autofocus @change="changeInput" clearable v-model:value="code" maxlength="5"
4141
:disabled="inputDisable" placeholder="请输入五位取件码">
4242
</el-input>
4343
</el-col>
@@ -236,6 +236,14 @@
236236
}
237237
});
238238
},
239+
watch: {
240+
code: function (code) {
241+
if (code.length === 5) {
242+
this.inout_disable = true;
243+
this.getFile();
244+
}
245+
}
246+
},
239247
methods: {
240248
http: function (method, url, data = {}, config = {}) {
241249
return new Promise((resolve, reject) => {
@@ -274,10 +282,9 @@
274282
if (this.code.length < 5) {
275283
this.code += value;
276284
}
277-
if (this.code.length === 5) {
278-
this.inout_disable = true;
279-
this.getFile();
280-
}
285+
},
286+
changeInput: function (value) {
287+
this.code = value;
281288
},
282289
toUploadData: function () {
283290
if (this.uploadData.text === '' && this.uploadData.file === null) {

0 commit comments

Comments
 (0)