1.0.2 • Published 4 years ago

@sanillajs/sanilla-router v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

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