mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-01-18 07:23:15 +01:00
⚡ better helloWorld.js
This commit is contained in:
parent
c391c6549b
commit
e884f871b0
@ -1,15 +1,19 @@
|
||||
import { el } from "deka-dom-el";
|
||||
import { S } from "deka-dom-el/signals";
|
||||
const clicks= S(0); // A
|
||||
document.body.append(
|
||||
el().append(
|
||||
const threePS= ({ emoji= "🚀" })=> {
|
||||
const clicks= S(0); // A
|
||||
return el().append(
|
||||
el("p", S(()=>
|
||||
"Hello World "+"🎉".repeat(clicks()) // B
|
||||
"Hello World "+emoji.repeat(clicks()) // B
|
||||
)),
|
||||
el("button", {
|
||||
type: "button",
|
||||
onclick: ()=> clicks(clicks()+1), // C
|
||||
textContent: "Fire",
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
||||
document.body.append(
|
||||
el(threePS, { emoji: "🎉" }),
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user