diff --git a/docs/p06-customElement.html b/docs/p06-customElement.html index af281da..9b15916 100644 --- a/docs/p06-customElement.html +++ b/docs/p06-customElement.html @@ -54,7 +54,7 @@ instance.addEventListener( document.body.append( instance, ); -

Custom Elements with DDE

The customElementWithDDE function is only (small) part of the inregration of the library. More important for coexistence is render component function as a body of the Custom Element.

import { +

Custom Elements with DDE

The customElementWithDDE function is only (small) part of the inregration of the library. More important for coexistence is render component function as a body of the Custom Element. For that, you can use customElementRender with arguments instance reference, target for connection, render function and optional properties (will be passed to the render function) see later…

import { customElementRender, customElementWithDDE, } from "./esm-with-signals.js"; @@ -79,7 +79,7 @@ function ddeComponent({ attr }){ ); return el().append( el("p", `Hello from Custom Element with attribute '${attr}'`) - ) + ); } customElementWithDDE(HTMLCustomElement); customElements.define(HTMLCustomElement.tagName, HTMLCustomElement); @@ -87,4 +87,4 @@ customElements.define(HTMLCustomElement.tagName, HTMLCustomElement); document.body.append( el(HTMLCustomElement.tagName, { attr: "Attribute" }) ); -

# Mnemonic

\ No newline at end of file +

…as you can see, you can use components created based on the documentation previously introduced. To unlock full potential, use with combination customElementWithDDE (allows to use livecycle events) and observedAttributes (converts attributes to render function arguments — default) or S.observedAttributes (converts attributes to signals).

# Mnemonic

\ No newline at end of file diff --git a/docs_src/components/examples/customElement/dde.js b/docs_src/components/examples/customElement/dde.js index db38432..4cde9a6 100644 --- a/docs_src/components/examples/customElement/dde.js +++ b/docs_src/components/examples/customElement/dde.js @@ -23,7 +23,7 @@ function ddeComponent({ attr }){ ); return el().append( el("p", `Hello from Custom Element with attribute '${attr}'`) - ) + ); } customElementWithDDE(HTMLCustomElement); customElements.define(HTMLCustomElement.tagName, HTMLCustomElement); diff --git a/docs_src/p06-customElement.html.js b/docs_src/p06-customElement.html.js index d7a3f68..c6caadd 100644 --- a/docs_src/p06-customElement.html.js +++ b/docs_src/p06-customElement.html.js @@ -76,7 +76,10 @@ export function page({ pkg, info }){ `), el(example, { src: fileURL("./components/examples/customElement/dde.js"), page_id }), el("p").append(...T` - … + …as you can see, you can use components created based on the documentation previously introduced. To unlock + full potential, use with combination ${el("code", "customElementWithDDE")} (allows to use livecycle events) + and ${el("code", "observedAttributes")} (converts attributes to render function arguments — + ${el("em", "default")}) or ${el("code", "S.observedAttributes")} (converts attributes to signals). `),