跳转到正文

组件

文件上传

支持多文件的拖放区域和文件选择器。

用法

基础

HTML
<bs:bsui-file-upload accept="image/*" multiple="true" />

单个文档

一次选择一个文件,并限定为导入器接受的扩展名。

HTML
<bs:bsui-file-upload name="invoice" accept=".pdf,.csv" />

带标签的字段

帮助文本说明 accept 列表无法表达的大小和格式规则。

PNG or SVG, at least 512 pixels wide.
HTML
<bs:bsui-field>
  <bs:bsui-field-label text="Company logo" />
  <bs:bsui-file-upload name="logo" accept="image/png,image/svg+xml" />
  <bs:bsui-field-description text="PNG or SVG, at least 512 pixels wide." />
</bs:bsui-field>

已禁用

投放区域变暗,且不再接受点击或拖放操作。

HTML
<bs:bsui-file-upload accept="image/*" disabled="true" />

属性

属性类型默认
name text —
accept text *
multiple toggle false
disabled toggle false
nameAlt text —