Skip to content

Commit

Permalink
feat: 新增getChildren
Browse files Browse the repository at this point in the history
  • Loading branch information
Yan Heng committed Aug 2, 2023
1 parent cc605d8 commit 6426b4e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ export class App extends BaseService<EventArgs> {
this.render();
}

public _update(): void {}

public getChildrenById(id: string): ChildType | undefined {
return this.getChildren((child) => child.id() === id)?.[0];
}

public getChildren(selector: (child: ChildType) => boolean): ChildType[] {
return this.mainLayer.find(selector) ?? [];
}

public triggerSelector(enable?: boolean): void {
this.cancelSelect();
this.selector.triggerSelector(enable);
Expand Down

0 comments on commit 6426b4e

Please sign in to comment.