关闭弹窗文件列表依然存在问题
1.随机数完美解决
import { Modal, Upload, Button } from 'antd';
import { InboxOutlined } from '@ant-design/icons';
FileUpload(sub) {
return <div key={Math.random()}>
<Dragger
defaultFileList={sub.defaultFileList}
beforeUpload={(f, fList) => false}
onChange={sub.handleFileChange}
maxCount={1}
accept={'.xlsx,.xls'}
>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传</p>
<p className="ant-upload-hint">
仅支持扩展名:.xlsx,.xls
</p>
</Dragger>
</div>
}