未验证 提交 487994af 编写于 作者: J junjun666 提交者: GitHub

fix: uploader 组件 beforeUpload 方法 ts 类型修复 (#601)

上级 e99c11cc
......@@ -70,7 +70,7 @@ export interface UploaderProps extends BasicComponent {
fileList: FileItem[]
event: React.ChangeEvent<HTMLInputElement>
}) => void
onBeforeUpload?: (file: File[]) => Promise<File[]>
onBeforeUpload?: (file: File[]) => Promise<File[] | boolean>
onBeforeXhrUpload?: (xhr: XMLHttpRequest, options: any) => void
onBeforeDelete?: (file: FileItem, files: FileItem[]) => boolean
onFileItemClick?: (file: FileItem) => void
......@@ -378,7 +378,7 @@ const InternalUploader: ForwardRefRenderFunction<
if (onBeforeUpload) {
onBeforeUpload(new Array<File>().slice.call(files)).then(
(f: Array<File>) => {
(f: Array<File> | boolean) => {
const _files: File[] = filterFiles(new Array<File>().slice.call(f))
readFile(_files)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册