Commit 27c86e34e1914d7cdf61a298745216ae3ecef053
Committed by
GitHub
Merge pull request #1572 from rijn/1504
Skip checking children if it was empty
Showing
2 changed files
with
3 additions
and
2 deletions
Show diff stats
examples/routers/tree.vue
src/components/tree/tree.vue
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 | // init checked status |
72 | 72 | function reverseChecked(data) { |
73 | 73 | if (!data.nodeKey) data.nodeKey = key++; |
74 | - if (data.children) { | |
74 | + if (data.children && data.children.length) { | |
75 | 75 | let checkedLength = 0; |
76 | 76 | data.children.forEach(node => { |
77 | 77 | if (node.children) node = reverseChecked(node); | ... | ... |