Examples
Practical examples। Live demos।
कोई example चुनिए और फ़ुल-स्क्रीन में खोलिए: live preview और source code साथ-साथ।
कोई example चुनिए और फ़ुल-स्क्रीन में खोलिए: live preview और source code साथ-साथ।
Docs एक layout है जिसके child routes हैं। topic उसके outlet() में render होता है और ./topic links layout के route के relative resolve होते हैं। notes लिखिए, फिर topic बदलिए: layout दोबारा नहीं बनता।
nuclo-router nuclo के साथ नहीं आता, इसे अलग से install करना होगा:npm install nuclo nuclo-router// Docs.ts: a layout page. Its child route renders inside outlet(), and // moving between topics never rebuilds this page: the input keeps its text. import type { PageProps, RouteContext } from "nuclo-router"; import { router } from "../routes.ts"; import { s } from "../styles.ts"; const topics = ["intro", "install", "api"]; export default function Docs(_ctx: RouteContext, { outlet }: PageProps) { return div( h1("Docs"), div( s.docs, aside( s.side, // "./intro" resolves against this page's route: /docs/intro ...topics.map((t) => a({ href: router.href(`./${t}`) }, t)), input({ placeholder: "Notes (kept)" }), ), section(outlet()), ), ); }