选择器
eui-filebutton
继承
LinkButtonComponent
用法
<eui-filebutton (select)="onFileSelect($event)" style="width:100px">Select a file</eui-filebutton>
输入
名称 |
类型 |
描述 |
默认 |
名称 |
string |
字段名。 |
file |
accept |
string |
指定服务器接受的文件类型。 |
null |
capture |
string |
媒体捕捉,如照相机或麦克风。 |
null |
multiple |
boolean |
定义是否接受多个文件。 |
false |
url |
string |
上传文件的url。 |
null |
method |
string |
文件上传到服务器的http方法。 |
POST |
autoUpload |
boolean |
定义选择文件时是否上传文件。 |
true |
withCredentials |
boolean |
定义是否应该使用凭据触发跨站点访问控制请求。 |
true |
事件
名称 |
参数 |
描述 |
select |
files:File[] |
选择文件时触发。 |
progress |
percent:number |
上传进度数据可用时触发。 |
success |
xhr,files |
当上传操作成功完成时触发。 |
error |
xhr,files |
当上传文件时发生错误时触发。 |
方法
名称 |
参数 |
返回值 |
描述 |
clear |
无 |
void |
清除输入的文件。 |