@sanillajs/sanilla-router
v1.0.2
Published
HTML5 history api router for [Sanilla](https://github.com/sanillajs/sanilla)
Downloads
1
Maintainers
Readme
Sanilla Router
HTML5 history api router for Sanilla
Install
npm
npm install -D @sanillajs/sanilla-router
yarn
yarn add -D @sanillajs/sanilla-router
How to use
import Sanilla from '@sanillajs/sanilla';
import SanillaRouter from '@sanillajs/sanilla-router';
import app from './app.html';
import home from './views/home.html';
import about from './views/about.html';
import hello from './views/hello.html';
Sanilla.append('#root', app);
Sanilla.router = new SanillaRouter('#router', {
'/': home,
'/about': about,
'/hello': hello,
});