1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-04 05:32:13 +02:00

improved customElementRender

This commit is contained in:
2024-12-13 13:53:41 +01:00
parent 99d073b87a
commit 3d0aeafc5c
6 changed files with 495 additions and 490 deletions

View File

@ -12,7 +12,7 @@ export class CustomHTMLTestElement extends HTMLElement{
}
connectedCallback(){
if(!this.hasAttribute("pre-name")) this.setAttribute("pre-name", "default");
customElementRender(this, this.attachShadow({ mode: "open" }), this.render, this.attributes)
customElementRender(this.attachShadow({ mode: "open" }), this.render, this.attributes)
}
attributes(element){
@ -22,7 +22,7 @@ export class CustomHTMLTestElement extends HTMLElement{
render({ name, preName, test }){
console.log(scope.state);
scope.host(
on.connected(()=> console.log(CustomHTMLTestElement)),
on.connected(console.log),
on.attributeChanged(e=> console.log(e)),
on.disconnected(()=> console.log(CustomHTMLTestElement))
);
@ -63,7 +63,7 @@ export class CustomSlottingHTMLElement extends HTMLElement{
));
}
connectedCallback(){
customElementRender(this, this, this.render);
customElementRender(this, this.render);
}
}
customElementWithDDE(CustomSlottingHTMLElement);