mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-01-18 15:33:14 +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 { el } from "deka-dom-el";
|
||||||
import { S } from "deka-dom-el/signals";
|
import { S } from "deka-dom-el/signals";
|
||||||
|
const threePS= ({ emoji= "🚀" })=> {
|
||||||
const clicks= S(0); // A
|
const clicks= S(0); // A
|
||||||
document.body.append(
|
return el().append(
|
||||||
el().append(
|
|
||||||
el("p", S(()=>
|
el("p", S(()=>
|
||||||
"Hello World "+"🎉".repeat(clicks()) // B
|
"Hello World "+emoji.repeat(clicks()) // B
|
||||||
)),
|
)),
|
||||||
el("button", {
|
el("button", {
|
||||||
type: "button",
|
type: "button",
|
||||||
onclick: ()=> clicks(clicks()+1), // C
|
onclick: ()=> clicks(clicks()+1), // C
|
||||||
textContent: "Fire",
|
textContent: "Fire",
|
||||||
})
|
})
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
document.body.append(
|
||||||
|
el(threePS, { emoji: "🎉" }),
|
||||||
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user