Added deconstruct functionality and cleanup code so that everything gets correctly cleaned up once a element is removed from the DOM. Added a new property template that allows properties to be used as content or html anywhere within a template's children. Next up is slot support.
This commit is contained in:
@ -8,9 +8,10 @@ class Sheet extends IgniteElement {
|
||||
this.show = false;
|
||||
this.items = [];
|
||||
this.href = "www.google.com";
|
||||
this.name = "default content";
|
||||
}
|
||||
|
||||
properties() {
|
||||
get properties() {
|
||||
return [
|
||||
"show",
|
||||
"name",
|
||||
@ -26,10 +27,9 @@ class Sheet extends IgniteElement {
|
||||
new div(
|
||||
new html("<h2>this is before</h2>"),
|
||||
new list(this.items, (item) => {
|
||||
return new a(`${item}`).attribute("href", this.href)
|
||||
return new a(this.name).attribute("href", this.href)
|
||||
}),
|
||||
new html("<h2>this is after</h2>"),
|
||||
new a("this is a link").attribute("href", this.href)
|
||||
new html("<h2>this is after</h2>")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user