mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-04-03 04:25:53 +02:00
19 lines
390 B
JavaScript
19 lines
390 B
JavaScript
import { el } from "deka-dom-el";
|
|
import { S } from "deka-dom-el/signals";
|
|
document.body.append(
|
|
el(HelloWorldComponent)
|
|
);
|
|
function HelloWorldComponent(){
|
|
const clicksS= S(0); // A
|
|
return el().append(
|
|
el("p", S(()=>
|
|
"Hello World "+"🎉".repeat(clicksS()) // B
|
|
)),
|
|
el("button", {
|
|
type: "button",
|
|
onclick: ()=> clicksS(clicksS()+1), // C
|
|
textContent: "Fire",
|
|
})
|
|
)
|
|
}
|