1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-23 09:09:38 +01:00
deka-dom-el/docs_src/components/examples/helloWorld.js

16 lines
307 B
JavaScript
Raw Normal View History

import { el } from "deka-dom-el";
2023-11-24 20:51:39 +01:00
import { O } from "deka-dom-el/observables";
const clicks= O(0);
2023-09-26 16:02:10 +02:00
document.body.append(
el().append(
2023-11-24 20:51:39 +01:00
el("p", O(()=>
2023-09-26 16:02:10 +02:00
"Hello World "+"🎉".repeat(clicks())
)),
el("button", {
type: "button",
onclick: ()=> clicks(clicks()+1),
textContent: "Fire"
})
)
);