From 6d01c9373f912f46fc10b25a5096152d2794ade5 Mon Sep 17 00:00:00 2001 From: zhaoxiaoqiang <l287285524@qq.com> Date: Fri, 05 Aug 2022 00:37:25 +0800 Subject: [PATCH] 22323 --- src/components/upload/uploadIdCard.vue | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/upload/uploadIdCard.vue b/src/components/upload/uploadIdCard.vue index 0a9766c..584d507 100644 --- a/src/components/upload/uploadIdCard.vue +++ b/src/components/upload/uploadIdCard.vue @@ -24,7 +24,7 @@ <input style="cursor:pointer" type="file" - id="androidInputFileImage" + ref="androidInputFileImage" @change="handlePhotoChange($event, 1)" accept="image/jpg, image/jpeg, image/png" @@ -34,7 +34,7 @@ <input style="cursor:pointer" type="file" - id="androidInputFileCapture" + ref="androidInputFileCapture" @change="handlePhotoChange($event, 2)" accept="image/*" @@ -325,16 +325,14 @@ // this.$refs.androidInputFileCapture.dispatchEvent( // new MouseEvent("click") // ); - setTimeout(() => { + this.$nextTick(()=>{ this.$refs.androidInputFileCapture.click(); - },0) - + }) } else { // this.$refs.androidInputFileImage.dispatchEvent(new MouseEvent("click")); - setTimeout(() => { - this.$refs.androidInputFileImage.click(); - },0) - + this.$nextTick(()=>{ + this.$refs.androidInputFileImage.click(); + }) } this.selectModel = false; }, -- Gitblit v1.8.0