feat: allow multiple files to be uploaded

This commit is contained in:
chenos 2020-12-30 11:20:46 +08:00
parent 41755a8af4
commit c20494d99b

View File

@ -96,6 +96,12 @@ export const getImageByUrl = (url, options) => {
} }
function toFileObject(item) { function toFileObject(item) {
console.log(item);
if (typeof item !== 'object') {
return {
id: item,
}
}
if (item.id && item.uid && item.url) { if (item.id && item.uid && item.url) {
return item; return item;
} }
@ -143,6 +149,7 @@ export const Upload = connect({
<AntdUpload <AntdUpload
{...uploadProps} {...uploadProps}
fileList={fileList} fileList={fileList}
multiple={true}
> >
<Button><UploadOutlined /> </Button> <Button><UploadOutlined /> </Button>
</AntdUpload> </AntdUpload>