首先通过attr为标签添加属性,属性值为对应图片下标index;
然后在on里边通过e.target点击事件获取点中的标签,然后获取属性uid对的值,传参
{title: '一审修改',key: 'oneshen',render: (h, params) => {// console.log(params.row)let list = params.row.dlist;let arr=[]for(let i in list){arr.push( [h('img', {props: {type: 'primary',size: 'small'},attrs: {src: params.row.list[i].photo, uid : i , style: "width: 100px;height: 100px;" },style: {},on: {click: (e) => {let id = e.target.getAttribute("uid");this.firstshen(params.index,id);}}}),])}return h('div', {},arr);}},
其次通过函数接收表格对应行的id和点击图片的index
firstshen (index,id) {let arr = this.data1[index].dlist},