Merge pull request #1572 from rijn/1504
Skip checking children if it was empty
This commit is contained in:
commit
27c86e34e1
2 changed files with 3 additions and 2 deletions
|
@ -29,7 +29,8 @@
|
|||
},
|
||||
{
|
||||
title: 'child2',
|
||||
id: '1-2'
|
||||
id: '1-2',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
// init checked status
|
||||
function reverseChecked(data) {
|
||||
if (!data.nodeKey) data.nodeKey = key++;
|
||||
if (data.children) {
|
||||
if (data.children && data.children.length) {
|
||||
let checkedLength = 0;
|
||||
data.children.forEach(node => {
|
||||
if (node.children) node = reverseChecked(node);
|
||||
|
|
Loading…
Add table
Reference in a new issue