Upload
File selection upload control.
Default
PreviewCode
Upload List
PreviewCode
card.png (NaN KB)
avatar.png (NaN KB)
Count Limit
PreviewCode
Size Limit
PreviewCode
Format Limit
PreviewCode
Before
PreviewCode
Props
Universal Props


Prop | Type | Accepted Values | Description | Default | Verson |
|---|---|---|---|---|---|
accept | string | image/* | video/* | audio/* | specify the allowed file types. For security reasons, it is recommended to only allow image files to be uploaded. For more formats, please refer to https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/file | image/* | - |
multiple | boolean | boolean | enable multiple file uploads | false | - |
onChange | () => void | - | callback function when the uploaded file changes | - | - |
beforeUpload | () => void | - | callback function before uploading a file | - | - |
files | array | array | upload file list | [] | - |
showUploadList | boolean | boolean | show upload list | true | - |
maxCount | number | number | maximum number of uploads | 20 | - |
maxSize | number | number | maximum upload file size(MB) | 100 | - |
btnText | string | string | upload button text | 选择文件 | 0.5.1 |
btnStyle | object | object | upload button style | - | 0.5.1 |
showSize | boolean | boolean | show file size | true | 0.5.1 |
sx | object | object | inline styles for customizing components. Note: Inline styles set using the 'style' property will override the 'sx' property. | - | - |
className | string | string | defines the class name of the component. | - | - |
style | object | object | defines inline styles for a component. | - | - |