1.0.0 • Published 5 years ago
blunt-svelte-router v1.0.0
Blunt Svelte Router
A little router for svelte
Recommendations
I should tell you why you shouldn't use this router than recommend it. Better try Routify or Tinro or any other router
Installation
yarn add blunt-svelte-router
Use
<script>
import { Route, Link } from 'blunt-svelte-router';
import { Router as goto } from 'blunt-svelte-router';
const clickHandler = () => {
goto('/wow');
}
</script>
<nav>
<p on:click={clickHandler}>Navigate programmatically (Click me)</p>
<Link to="/">
Home
</Link>
<Link to="/about">
About
</Link>
</nav>
<Route path="/">
<h1>Home</h1>
</Route>
<Route path="/about">
<h1>About</h1>
</Route>
<Route path="/wow">
<h1>Uh?</h1>
</Route>