From 45746111b8690beaaaf3b3004dc855cbe717e13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Mon, 31 Oct 2022 22:27:56 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(upload):=20=E4=BF=AE=E5=A4=8D=20up?= =?UTF-8?q?load=20=E7=BB=84=E4=BB=B6=E8=BF=9E=E7=BB=AD=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E7=9B=B8=E5=90=8C=E6=96=87=E4=BB=B6=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=A7=A6=E5=8F=91=E4=B8=8A=E4=BC=A0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/src/component/upload/index.vue | 3 ++- .../src/document/zh-CN/components/upload.md | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package/component/src/component/upload/index.vue b/package/component/src/component/upload/index.vue index b38f1912..0cc84f6c 100644 --- a/package/component/src/component/upload/index.vue +++ b/package/component/src/component/upload/index.vue @@ -234,7 +234,7 @@ const errorF = (errorText: string) => { }; const localUpload = (option: localUploadOption, callback: Function) => { - let xhr: XMLHttpRequest, loadedevt, total, per: number, url, uploading; + let xhr: XMLHttpRequest, url; xhr = new XMLHttpRequest(); url = option.url; let formData = option.formData; @@ -279,6 +279,7 @@ const localUpload = (option: localUploadOption, callback: Function) => { if (cb && typeof cb == "function") { cb(); } + (orgFileInput.value as HTMLInputElement).value = ""; }; const filetoDataURL = (file: File, fn: Function) => { diff --git a/package/document-component/src/document/zh-CN/components/upload.md b/package/document-component/src/document/zh-CN/components/upload.md index d6803c8b..fb881ae5 100644 --- a/package/document-component/src/document/zh-CN/components/upload.md +++ b/package/document-component/src/document/zh-CN/components/upload.md @@ -13,7 +13,7 @@ ::: demo 使用 `lay-upload` 标签, 创建一个上传按钮