使用element组件时,会遇到需要将自己自定义的参数,这时候直接将参数代入到事件中,会获取不到你所传的值,导致页面报错。
解决方法: (i)=>function(i,v)
<el-upload
:show-file-list="false"
:on-success="(res,file)=>handleAvatarSuccess1(res,file,index)"
:before-upload="beforeAvatarUpload"
class="avatar-uploader"
action="#">
<img v-if="item.url" :src="item.url" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"/>
</el-upload>