Refactor components to simplify them
This commit is contained in:
parent
3cf5b14913
commit
077ed9d3bf
36 changed files with 202 additions and 216 deletions
|
|
@ -4,6 +4,11 @@ export abstract class PageElement {
|
|||
protected children: Array<PageElement> = []
|
||||
) {}
|
||||
|
||||
public attachToDOM(target: HTMLElement) {
|
||||
target.appendChild(this.htmlRoot);
|
||||
this.setParent(null);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
protected setParent(parent?: PageElement | null): void {
|
||||
this.children.forEach((c) => c.setParent(this));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue