Parcourir la source

style: 拼写错误:chilren->children

qinlaiqiao il y a 5 ans
Parent
commit
d286eed92d
1 fichiers modifiés avec 5 ajouts et 5 suppressions
  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()] || [];
   }
 
   firstChild(): TreeNode | None {
-    return this.chilren()[0] || null;
+    return this.children()[0] || null;
   }
 
   lastChild(): TreeNode | None {
-    const children = this.chilren();
+    const children = this.children();
     return children[children.length - 1] || null;
   }
 
@@ -87,13 +87,13 @@ export class NodeContext {
     const getChild = (nodes: TreeNode[]): void => {
       nodes.forEach(node => {
         posterity.push(node);
-        const children = node.getCtx().chilren();
+        const children = node.getCtx().children();
         if (children.length) {
           getChild(children);
         }
       });
     };
-    getChild(this.chilren());
+    getChild(this.children());
     return posterity;
   }