Преглед изворни кода

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/SCCommon

vian пре 5 година
родитељ
комит
dc51341fc5
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      tree/src/nodeCtx.ts

+ 5 - 5
tree/src/nodeCtx.ts

@@ -68,16 +68,16 @@ export class NodeContext {
   }
   }
 
 
   // 获取节点子项
   // 获取节点子项
-  chilren(): TreeNode[] {
+  children(): TreeNode[] {
     return this.tree.parentMap[this.ID()] || [];
     return this.tree.parentMap[this.ID()] || [];
   }
   }
 
 
   firstChild(): TreeNode | None {
   firstChild(): TreeNode | None {
-    return this.chilren()[0] || null;
+    return this.children()[0] || null;
   }
   }
 
 
   lastChild(): TreeNode | None {
   lastChild(): TreeNode | None {
-    const children = this.chilren();
+    const children = this.children();
     return children[children.length - 1] || null;
     return children[children.length - 1] || null;
   }
   }
 
 
@@ -87,13 +87,13 @@ export class NodeContext {
     const getChild = (nodes: TreeNode[]): void => {
     const getChild = (nodes: TreeNode[]): void => {
       nodes.forEach(node => {
       nodes.forEach(node => {
         posterity.push(node);
         posterity.push(node);
-        const children = node.getCtx().chilren();
+        const children = node.getCtx().children();
         if (children.length) {
         if (children.length) {
           getChild(children);
           getChild(children);
         }
         }
       });
       });
     };
     };
-    getChild(this.chilren());
+    getChild(this.children());
     return posterity;
     return posterity;
   }
   }