create-vanjs
Version:
🍦 Quick tool for scaffolding your first VanJS project
39 lines (35 loc) • 862 B
text/typescript
import van from "npm:vanjs-core";
import Counter from "./components/counter.ts";
import "./app.css";
export const App = () => {
const { div, h1, img, p, a } = van.tags;
return div(
a(
{ href: "https://deno.com", target: "_blank" },
img({
src: "/vite-deno.svg",
class: "logo",
alt: "Vite with Deno logo",
width: 96,
height: 96,
}),
),
a(
{ href: "https://vanjs.org", target: "_blank" },
img({
src: "/vanjs.svg",
class: "logo vanjs",
alt: "VanJS logo",
width: 96,
height: 96,
}),
),
h1(
"Hello VanJS!",
),
div({ class: "card" }, Counter()),
p({ class: "read-the-docs" }, "Click on the VanJS logo to learn more"),
);
};
const root = document.getElementById("app") as HTMLElement;
van.add(root, App());