element table 表格嵌套
/////////////////////////// 代码如下
:height=reportTableConfig.tableHeight
style="width: 100%;margin-bottom: 20px;"
:span-method="arraySpanMethod"
row-key="id"
border
stripe
>
:data="props.row.datas"
style="width: 100%;"
:span-method="arraySpanMethod"
row-key="id"
border
stripe
>
:data="props.row.datas"
style="width: 100%;"
row-key="id"
border
stripe
>
export default {
components: {
},
data() {
return {
filterText: '',
keyWord: '',
//////////////////////-------------------
tableData: [
{
id: 1,
applyNo: '202004291234',
name: '李四',
address: '上海市普陀区金沙江路 1518 弄',
datas: [
{
id: 31,
date: '2016-05-01',
type: '类型1',
status: '已发货',
datas: [
{
id: 1,
number: '2021-04-01',
name: 'name1',
age: '17'
},
{
id: 2,
number: '2021-05-01',
name: 'name2',
age: '18'
}
]
},
{
id: 32,
date: '2016-05-02',
type: '类型2',
status: '未发货'
}
]
},
{
id: 2,
applyNo: '202004291235',
name: '张三',
address: '上海市普陀区金沙江路 1517 弄'
},
{
id: 4,
applyNo: '202004291238',
name: '赵6六',
address: '上海市普陀区金沙江路 1516 弄'
}
],
radio: 'today',
}
},
created() {
},
methods: {
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if (!row.datas) {
if (columnIndex === 0) {
console.log(row)
// return [0, 0]
return [0, 0]
} else if (columnIndex === 1) {
// return [1, 2]
return [1, 2]
}
}
},
},
}