vue element ui el-upload 上传组件在成功,失败等钩子函数增加参数
这是官方文档中对钩子函数的描述![](https://i-blog.csdnimg.cn/blog_migrate/19894ec317d2a69af8489bd068c2e414.png)
如何增加自定义的参数?
<el-upload
class="inline-block"
:action="url()"
:headers="heards"
:show-file-list="false"
:on-error="uploadError"
:on-success="(response,file,fileList)=>{return uploadSucess(response,file,fileList, scope.$index,cardList[scope.$index].cardPath)}">
<el-button type="primary" size="mini">上传附件</el-button>
</el-upload>
如图所示在on-success 增加一个箭头函数 返回一个自定义的函数将当前行的索引和想要的参数传入即可