mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-07-01 12:22:15 +02:00
⚡ Docs
This commit is contained in:
18
docs/components/examples/scopes/cleaning.js
Normal file
18
docs/components/examples/scopes/cleaning.js
Normal file
@ -0,0 +1,18 @@
|
||||
import { el, empty, on } from "deka-dom-el";
|
||||
document.body.append(
|
||||
el(component),
|
||||
el("button", {
|
||||
textContent: "Remove",
|
||||
onclick: ()=> empty(document.body),
|
||||
type: "button"
|
||||
})
|
||||
);
|
||||
import { S } from "deka-dom-el/signals";
|
||||
function component(){
|
||||
const textContent= S("Click to change text.");
|
||||
|
||||
const onclickChange= on("click", function redispatch(){
|
||||
textContent("Text changed! "+(new Date()).toString())
|
||||
});
|
||||
return el("p", textContent, onclickChange);
|
||||
}
|
Reference in New Issue
Block a user