若是有多條數據,想要在iview的table表格中循環出來,利用render函數:數組
{
title: '列名',
key: 'key值',
className:'operationContent',
minWidth: 750,
render: (h, params) => {
var arr = params.row.content;//數據數組
var newArr = [];
arr.forEach((a,index)=>{
newArr.push(h('div',[
h('span', (index+1)+'、'),
h('span', a)
]))
})
return h('div',newArr);
}
},
iview