Skip to content

Upload 上传

点击或拖拽选择文件,展示文件列表与上传进度。

基础用法

基础(选择文件)

多选与数量限制

多选 + max

max 限制最多可选文件数,accept 过滤文件类型。

自动上传

自动上传(模拟进度)

auto-upload 时添加文件即自动模拟上传进度,进度条复用 oas-progress

禁用

禁用

事件

变化事件

监听 oas-change / oas-remove / oas-upload

API

属性

属性说明类型默认值
accept接受的文件类型string
auto-upload添加后自动模拟上传boolean
disabled禁用boolean
files文件列表(property,File[]File[][]
max最大文件数string0
multiple多选boolean

事件

事件说明
oas-change文件列表变化,detail: { files }
oas-remove移除文件,detail: { file, index }
oas-upload上传进度,detail: { file, percent, status }

键盘:拖拽区 Enter / 空格 打开文件选择;删除按钮可聚焦。