0.0.7 • Published 4 years ago

easy-element-upload v0.0.7

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

说明

参数说明类型默认值
action-urlactionstring
extro-param上传需要的额外参数object
max-size每次上传最大文件 单位Mnumber50
disabled是否禁用booleanfalse
multiple是否支持多个booleantrue
inline已上传文件列表与按钮是否内联booleanfalse
show-file-list是否显示已上传文件列表booleantrue
show-loading是否显示loadingbooleantrue
file-name-key提交文件时文件名对应的keystring'filename'
previewBaseUrl上传后文件预览的baseUrl,如没有则取previewUrlKey对应值,且认为其是完整路径string
previewUrlKey上传后返回的预览url对应的keystring'viewUrl'
accept接受上传的文件类型string
limit最大允许上传个数number
clear()清空上传列表方法
@success每次上传成功后的回调,返回每次上传后端返回值function(res)
@change上传成功后回调,返回fileListfunction({fileList})

示例

<imp-upload
    :action-url="'/marketing-platform/file/upload'"
    :extro-param="{a: 1}"
    @success="onUploadSuccess"
    @change="onUploadChange"
>
</imp-upload>
onUploadSuccess(e) {
    console.log(e); // 服务器返回信息
},

onUploadChange (e) {
    this.formData.attachments = e.fileList;
    // 或者
    e.fileList.foreach(item => {
        this.formData.attachment[item.name] = item.viewUrl;
    });
}
0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago