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