소스 검색

Tree: fix insertChild (#21194)

好多大米 4 년 전
부모
커밋
4d7d24b200
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      packages/tree/src/model/node.js

+ 1 - 1
packages/tree/src/model/node.js

@@ -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);