场景:
el-table中嵌入el-upload组件
等所有数据添加完毕之后,统一上传
现在想把el-upload跟每一行的其他数据对应起来
也就说每一行的scope.row 要有一个file对应这个upload上传的文件this.file.file[0].raw
请教一下 改如何对应 现在迷糊的是不知道el-upload绑定什么方法或者数据 能获取到scope.row的数据
`
<el-table-column align="center" label="上传附件">
<template slot-scope="scope">
<el-form-item>
<el-upload action="#" accept="*" :on-change="fileChange" :limit="1" :auto-upload="false">
<el-button size="small" type="primary">浏览</el-button>
</el-upload>
</el-form-item>
</template>
</el-table-column>
`
像这样写
现在你的
fileChange
函数内得到了file
跟当前行数据对象,处理起来不难了