as detailed in the title:
multiple uploads are realized with the upload
component of antd
.
but select multiple files. The fileList
printed in the onChange
event is sometimes the normal number, and sometimes there is only one in . fileList
is also dynamically set in onChange
and updated to the property of upload
.
the onChange event was called only once as prompted by the official website. It is also done in this way, but it still has no effect. I don"t know how to solve it.
<Dropdown overlay={getMenu(onShowEditor, this.onUploadInvoice, fileList)}>
<Button type="primary" className={styles.filter_btn}>
{APPEND_RECORD_TITLE}
</Button>
</Dropdown>
const getMenu = (handleMenuClick, onUploadInvoice, fileList) => (
<Menu onClick={handleMenuClick}>
{/* <Menu.Item key="1">{SCANNING_NVOICE_TITLE}</Menu.Item> */}
<Menu.Item key="2" style={{padding: 0}}>
<span className={styles.upload_invoice_item} style={{}} onClick={(e) => e.stopPropagation()}>
<Upload
action={completeURL(INVOICE_OCR_URL)}
showUploadList={false}
onChange={onUploadInvoice}
name="invoiceFile"
headers= {{"Login_Token": localStorageUtil.get("TOKEN") || ""}}
multiple={true}
fileList={fileList}
>
{UPLOAD_TITLE}
</Upload>
</span>
</Menu.Item>
<Menu.Item key="3">{IMPORT_TITLE}</Menu.Item>
<Menu.Item key="4">{HANDLE_INPUT_TITLE}</Menu.Item>
</Menu>
);
onUploadInvoice (info) {
let {file, fileList} = info;
console.log(info);
this.setState({
isUploading: true,
fileList
});
}