update Table tree

This commit is contained in:
梁灏 2020-01-03 14:18:33 +08:00
parent 52a036ec43
commit 793b73035a
2 changed files with 6 additions and 2 deletions

View file

@ -24,6 +24,10 @@
title: 'Age', title: 'Age',
key: 'age' key: 'age'
}, },
{
title: 'Date',
key: 'date'
},
{ {
title: 'Address', title: 'Address',
key: 'address' key: 'address'

View file

@ -930,7 +930,7 @@
data.forEach((row, index) => { data.forEach((row, index) => {
row._index = index; row._index = index;
row._rowKey = rowKey++; row._rowKey = rowKey++;
if (row.child && row.children.length) { if (row.children && row.children.length) {
row.children = this.makeChildrenData(row); row.children = this.makeChildrenData(row);
} }
}); });
@ -938,7 +938,7 @@
}, },
makeChildrenData (data) { makeChildrenData (data) {
if (data.children && data.children.length) { if (data.children && data.children.length) {
data.children.map((row, index) => { return data.children.map((row, index) => {
const newRow = deepCopy(row); const newRow = deepCopy(row);
newRow._index = index; newRow._index = index;
newRow._rowKey = rowKey++; newRow._rowKey = rowKey++;