mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-07-01 12:22:15 +02:00
🔤 🐛 ⚡ v0.9.1-alpha (#30)
* :tap: removed on.attributeChanged and static observedAttributes * ⚡ import optimalization * ⚡ scope.signal * 🔤 🐛 * ⚡ 🐛 registerReactivity and types * 🔤 * ⚡ * 🔤 * 🐛 Node in enviroment * ⚡ todos * ⚡ * ⚡ 🔤 * ⚡ lint * ⚡ memo * 🔤 🐛 memo * ⚡ 🔤 todomvc * 🐛 types * 🔤 p08 signal factory * 🔤 ⚡ types * ⚡ 🔤 lint * 🔤 * 🔤 * 🔤 * 🔤 * 📺
This commit is contained in:
19
docs/components/examples/events/dispatch.js
Normal file
19
docs/components/examples/events/dispatch.js
Normal file
@ -0,0 +1,19 @@
|
||||
import { el, on, dispatchEvent, scope } from "deka-dom-el";
|
||||
document.body.append(
|
||||
el(component),
|
||||
);
|
||||
|
||||
function component(){
|
||||
const { host }= scope;
|
||||
const dispatchExample= dispatchEvent(
|
||||
"example",
|
||||
{ bubbles: true },
|
||||
host
|
||||
);
|
||||
|
||||
return el("div").append(
|
||||
el("p", "Dispatch events from outside of the component."),
|
||||
el("button", { textContent: "Dispatch", type: "button" },
|
||||
on("click", dispatchExample))
|
||||
);
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
import { el, on } from "deka-dom-el";
|
||||
const paragraph= el("p", "See live-cycle events in console.",
|
||||
const paragraph= el("p", "See lifecycle events in console.",
|
||||
el=> log({ type: "dde:created", detail: el }),
|
||||
on.connected(log),
|
||||
on.disconnected(log),
|
||||
on.attributeChanged(log));
|
||||
);
|
||||
|
||||
document.body.append(
|
||||
paragraph,
|
||||
|
Reference in New Issue
Block a user