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 | 最大文件数 | string | 0 |
multiple | 多选 | boolean | — |
事件
| 事件 | 说明 |
|---|---|
oas-change | 文件列表变化,detail: { files } |
oas-remove | 移除文件,detail: { file, index } |
oas-upload | 上传进度,detail: { file, percent, status } |
键盘:拖拽区 Enter / 空格 打开文件选择;删除按钮可聚焦。