Refactor and minor fixes
This commit is contained in:
parent
2dc9c45642
commit
fe75f9af88
31 changed files with 187 additions and 193 deletions
|
|
@ -3,8 +3,11 @@ import { PageElement } from '../page-element';
|
|||
import { generate } from './main.html';
|
||||
|
||||
export class Main extends PageElement {
|
||||
constructor(...children: Array<PageElement>) {
|
||||
super(createElement(generate()), children);
|
||||
children.forEach((c) => this.attachElement(c));
|
||||
constructor(...children: Array<PageElement | string>) {
|
||||
const actualChildren = children.map((c) =>
|
||||
c instanceof PageElement ? c : new PageElement(createElement(c))
|
||||
);
|
||||
super(createElement(generate()), actualChildren);
|
||||
actualChildren.forEach((c) => this.attachElement(c));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue