@mahaljs/router
v1.2.3
Published
The official router for mahal framework.
Downloads
9
Maintainers
Readme
mahal-router
Official router plugin for Mahal framework
Install
npm i @mahaljs/router
Setup
import { Timer, Mahal } from "mahal";
import Root from "./components/root.mahal";
import { RouterPlugin, Router } from "@mahaljs/router";
import { routes } from "./routes";
const router = new Router(routes, {
mode: "history"
});
const app = new Mahal(Root, '#app');
// add router as plugin
app.extend.plugin(RouterPlugin, router);
app.create();
Docs
https://mahaljs.com/docs/router/