1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-01-18 23:43:15 +01:00

20 lines
403 B
JavaScript
Raw Normal View History

2024-12-13 15:52:24 +01:00
import { el } from "deka-dom-el";
import { S } from "deka-dom-el/signals";
2024-12-13 19:37:52 +01:00
const threePS= ({ emoji= "🚀" })=> {
const clicks= S(0); // A
return el().append(
2024-12-13 15:52:24 +01:00
el("p", S(()=>
2024-12-13 19:37:52 +01:00
"Hello World "+emoji.repeat(clicks()) // B
2024-12-13 15:52:24 +01:00
)),
el("button", {
type: "button",
onclick: ()=> clicks(clicks()+1), // C
textContent: "Fire",
})
2024-12-13 19:37:52 +01:00
);
};
document.body.append(
el(threePS, { emoji: "🎉" }),
2023-09-26 16:02:10 +02:00
);
2024-12-13 19:37:52 +01:00