Refactor
This commit is contained in:
parent
b6aef2bcf8
commit
33051841f5
10 changed files with 32 additions and 39 deletions
|
|
@ -1,13 +1,13 @@
|
|||
import { createElement } from '../../helper/create-element';
|
||||
import { PageElement } from '../page-element';
|
||||
import { generate } from './main.html';
|
||||
|
||||
export class Main extends PageElement {
|
||||
constructor(...children: Array<PageElement | string>) {
|
||||
const actualChildren = children.map((c) =>
|
||||
c instanceof PageElement ? c : new PageElement(createElement(c))
|
||||
c instanceof PageElement ? c : new PageElement(c)
|
||||
);
|
||||
super(createElement(generate()), actualChildren);
|
||||
|
||||
super(generate(), actualChildren);
|
||||
actualChildren.forEach((c) => this.attachElement(c));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue