@sanillajs/sanilla-router

1.0.2 • Public • Published

Sanilla Router

HTML5 history api router for Sanilla

enter image description here

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,
});

Package Sidebar

Install

npm i @sanillajs/sanilla-router

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

60 kB

Total Files

5

Last publish

Collaborators

  • tree-some