Skip to content

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

NameTypeDefaultDescription
modelValueUploadFile[][]V-model value representing the selected files
namestring'file'The name of the input file field
actionstring''Upload URL
headersRecord<string, string>{}Request headers
dataRecord<string, any>{}Extra payload data
multiplebooleanfalseWhether multiple files are allowed
acceptstring''Accepted file types
maxCountnumber-Maximum number of files allowed
maxSizenumber-Maximum size of a file in bytes
disabledbooleanfalseWhether the upload is disabled
autoUploadbooleantrueWhether to automatically upload files after selection

BrUpload Emits

NameDescriptionParameters
update:modelValueEmitted when file list changes(files: UploadFile[])
changeEmitted when a file is selected(file: UploadFile, fileList: UploadFile[])
removeEmitted when a file is removed(file: UploadFile, fileList: UploadFile[])
successEmitted on successful upload(response: any, file: UploadFile, fileList: UploadFile[])
errorEmitted on upload error(error: Error, file: UploadFile, fileList: UploadFile[])
progressEmitted during upload progress(event: ProgressEvent, file: UploadFile, fileList: UploadFile[])
exceedEmitted when max count is exceeded(files: File[], fileList: UploadFile[])
previewEmitted when previewing a file(file: UploadFile)