eo-upload-file
<eo-upload-file>
上传文件
Examples
Basic
With Form
Properties
Name | Description | Type | Default | Required |
---|---|---|---|---|
label | 字段说明 | string | ||
name | 字段名称 | string | ||
required | 是否必填 | boolean | ||
message | 校验文本信息 | Record<string, string> | ||
value | 值 | FileData[] | ||
multiple | 是否支持多选 | boolean | ||
accept | 接受上传的文件类型,多个之间用 | string | ||
maxCount | 最大上传数量 | number | ||
limitSize | 上传大小限制(单位为 MB) | number | ||
buttonText | 上传按钮文本 | string | 上传 | |
buttonType | 上传按钮类型 | ButtonProps["type"] | ||
buttonIcon | 上传按钮类型 | GeneralIconProps | {
lib: "antd",
icon: "upload",
theme: "outlined",
} | |
overMaxCountMode | 超出最大上传数量时文件的保留方式 | "ignore" | "replace" | "replace" | |
uploadDraggable | 是否可以拖拽上传 | boolean | ||
draggableUploadTip | 拖拽上传的提示信息 | string | ||
autoUpload | 是否自动上传 | boolean | false | |
url | 自动上传的地址 | string | ||
method | 自动上传的方法 | string | "POST" | |
uploadName | 自动上传的文件参数名 | string | "file" |
Events
Name | Description | Event Detail |
---|---|---|
change | 值变化时触发 | FileData[] |
Type references
FileData
Name | Type | Required | Description |
---|---|---|---|
uid | string | ✅ | |
name | string | ✅ | |
file | File & { uid?: string } | ||
response | any | ||
userData | any | ||
status | UploadStatus | ||
errors | Error[] |
UploadStatus
"uploading" | "done" | "error"