Skip to content

FaFileUpload 文件上传 v5.6.0

Props

属性名说明类型默认值
modelValue绑定值FileItem[]-
action上传地址string-
method上传方法string'post'
headers请求头Headers | Record<string, any>-
data请求数据Record<string, any>-
name文件名string'file'
afterUpload上传成功后回调(response: any) => string | Promise<string>-
multiple是否多选booleanfalse
ext文件扩展名string[]-
max最大上传数量,为0则不限制number1
size最大上传大小,单位为字节,为0则不限制number5 * 1024 * 1024
hideTips隐藏提示booleanfalse
disabled是否禁用booleanfalse
ts
interface FileItem {
  name: string
  size: number
  url?: string
  status?: 'uploading' | 'success' | 'error'
  progress?: number
  file?: File
}

Events

事件名说明参数
onSuccess上传成功(response: any, file: File) => void
onClick点击(fileItem: FileItem, index: number) => void