element ui 中 下载的使用
在工作用到 el-upload 上传,这块有封装好的,是form表单上传,记录一下运用的
<el-upload
style="display: inline-block"
class="upload-demo"
action="xxxxxxxxxx"
name="remarkFile"
:show-file-list = false
:on-success="uploadSuccess"
:on-error="uploadError"
>
uploadSuccess(data){
if(data.code === 1){
this.$message.success(data.data) //成功的消息通知
}else{
this.$message.error(data.message) //失败的消息通知
}
},
uploadError(err) {
this.$message.error(data.data)
},
action 是请求地址
show-file-list 是否开启本地存储
name 请求的 字段参数
on-success 成功的方法
on-error 失败的方法
爱生活、爱编程!

浙公网安备 33010602011771号