1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-03 13:12:14 +02:00

🔤 updated docs (examples)

This commit is contained in:
2024-12-11 16:20:49 +01:00
parent 513c32eb37
commit bcddc75f56
3 changed files with 15 additions and 12 deletions

View File

@ -1,15 +1,18 @@
import { el } from "deka-dom-el";
import { S } from "deka-dom-el/signals";
const clicks= S(0); // A
document.body.append(
el().append(
el(HelloWorldComponent)
);
function HelloWorldComponent(){
const clicksS= S(0); // A
return el().append(
el("p", S(()=>
"Hello World "+"🎉".repeat(clicks()) // B
"Hello World "+"🎉".repeat(clicksS()) // B
)),
el("button", {
type: "button",
onclick: ()=> clicks(clicks()+1), // C
onclick: ()=> clicksS(clicksS()+1), // C
textContent: "Fire",
})
)
);
}