Upload
Upload files by selecting or dragging.
Basic Usage
Click or drag files to this area
Supports multi-file upload, max 5 files.
Example
Form Integration
The Upload component seamlessly integrates with BrForm and vee-validate.
Example
API
BrUpload Props
| Name | Type | Default | Description |
|---|---|---|---|
| modelValue | UploadFile[] | [] | V-model value representing the selected files |
| name | string | 'file' | The name of the input file field |
| action | string | '' | Upload URL |
| headers | Record<string, string> | {} | Request headers |
| data | Record<string, any> | {} | Extra payload data |
| multiple | boolean | false | Whether multiple files are allowed |
| accept | string | '' | Accepted file types |
| maxCount | number | - | Maximum number of files allowed |
| maxSize | number | - | Maximum size of a file in bytes |
| disabled | boolean | false | Whether the upload is disabled |
| autoUpload | boolean | true | Whether to automatically upload files after selection |
BrUpload Emits
| Name | Description | Parameters |
|---|---|---|
| update:modelValue | Emitted when file list changes | (files: UploadFile[]) |
| change | Emitted when a file is selected | (file: UploadFile, fileList: UploadFile[]) |
| remove | Emitted when a file is removed | (file: UploadFile, fileList: UploadFile[]) |
| success | Emitted on successful upload | (response: any, file: UploadFile, fileList: UploadFile[]) |
| error | Emitted on upload error | (error: Error, file: UploadFile, fileList: UploadFile[]) |
| progress | Emitted during upload progress | (event: ProgressEvent, file: UploadFile, fileList: UploadFile[]) |
| exceed | Emitted when max count is exceeded | (files: File[], fileList: UploadFile[]) |
| preview | Emitted when previewing a file | (file: UploadFile) |