UNPKG

@virtualstate/examples

Version:
22 lines 872 B
import { h, createFragment } from "@virtualstate/fringe"; import { render } from "@virtualstate/dom"; function SiteContents() { return (h(createFragment, null, h("p", null, "Hello World!"), h("button", { type: "button", onClick: () => alert("Button clicked!") }, "Press me!!"))); } async function Site() { const root = document.createElement("div"); await render(h(SiteContents), root); document.body.append(root); } export { Site, SiteContents }; export default (h("html", null, h("body", null, h("script", { type: "application/javascript" }, `const { h, createFragment } = await import("@virtualstate/fringe");`, `const { render } = await import("@virtualstate/dom");`, SiteContents.toString(), Site.toString(), `await Site()`)))); //# sourceMappingURL=button.js.map