From a0e94978f54892be499a84b9871314bbe8e47cc1 Mon Sep 17 00:00:00 2001 From: huyikai Date: Mon, 3 Jul 2023 21:25:29 +0800 Subject: [PATCH] docs: update upload demo ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 示例代码在运行时,ts类型报错.原因是试图在可能为 undefined 的对象上使用扩展运算符. --- components/upload/demo/upload-manually.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/upload/demo/upload-manually.vue b/components/upload/demo/upload-manually.vue index b06ae3841..c3b43d27b 100644 --- a/components/upload/demo/upload-manually.vue +++ b/components/upload/demo/upload-manually.vue @@ -57,7 +57,7 @@ export default defineComponent({ }; const beforeUpload: UploadProps['beforeUpload'] = file => { - fileList.value = [...fileList.value, file]; + fileList.value = [...(fileList.value || []), file]; return false; };