mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-25 01:39:37 +01:00
18 lines
452 B
JavaScript
18 lines
452 B
JavaScript
import { el } from "deka-dom-el";
|
|
document.head.append(
|
|
el("style").append(
|
|
".class1{ font-weight: bold; }",
|
|
".class2{ color: purple; }"
|
|
)
|
|
);
|
|
document.body.append(
|
|
el(component, { className: "class2", textContent: "Hello World!" }),
|
|
component({ className: "class2", textContent: "Hello World!" })
|
|
);
|
|
|
|
function component({ className, textContent }){
|
|
return el("div", { className: [ "class1", className ] }).append(
|
|
el("p", textContent)
|
|
);
|
|
}
|