docs: update upload demo ts

示例代码在运行时,ts类型报错.原因是试图在可能为 undefined 的对象上使用扩展运算符.
feat-v4^2
huyikai 2023-07-03 21:25:29 +08:00 committed by GitHub
parent 8212237045
commit a0e94978f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ export default defineComponent({
};
const beforeUpload: UploadProps['beforeUpload'] = file => {
fileList.value = [...fileList.value, file];
fileList.value = [...(fileList.value || []), file];
return false;
};