Tree: fix insertChild (#21194)

pull/21196/head
好多大米 2021-08-02 11:16:35 +08:00 committed by GitHub
parent 4943867337
commit 4d7d24b200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -220,7 +220,7 @@ export default class Node {
if (!(child instanceof Node)) {
if (!batch) {
const children = this.getChildren(true);
const children = this.getChildren(true) || [];
if (children.indexOf(child.data) === -1) {
if (typeof index === 'undefined' || index < 0) {
children.push(child.data);