From e7886a12245daceda0e1517e216afadb1bb8da8a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 10 Nov 2023 23:01:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E5=AD=90=E8=A1=A8=EF=BC=9A=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=88=97=E8=A1=A8=E7=BC=96=E8=BE=91=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=BB=84=E4=BB=B6=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 55f6e4ca25eb246d6c49327e0b23b6839d187c19) --- src/components/UploadFile/src/UploadFile.vue | 2 + .../infra/demo02/DemoStudentContactForm.vue | 68 +++++++++++++++++-- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index 6895440b..bba466a7 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -144,6 +144,8 @@ watch( } else if (isArray(props.modelValue)) { // 情况2:字符串 files.concat(props.modelValue) + } else if (props.modelValue === undefined) { + // 情况3:undefined 不处理 } else { throw new Error('不支持的 modelValue 类型') } diff --git a/src/views/infra/demo02/DemoStudentContactForm.vue b/src/views/infra/demo02/DemoStudentContactForm.vue index 50c44263..694aadac 100644 --- a/src/views/infra/demo02/DemoStudentContactForm.vue +++ b/src/views/infra/demo02/DemoStudentContactForm.vue @@ -9,20 +9,73 @@ > - + - + + + + + + + + + + + + + + + + + + +