svelte-routes
v0.0.4
Published
Routing for svelte v3.
Downloads
3
Readme
svelte-routes
A simple router for svelte v3.
Install
npm i --save svelte-routes
Usage
In routes.js
:
import MyComponent from './MyComponent.svelte';
import 404Page from './404Page.svelte';
const routes = [
{
to: '/',
component: MyComponent,
},
{
to: '*',
component: 404Page,
},
];
export default routes;
In App.svelte
:
<script>
import routes from './routes';
import { Router } from 'svelte-routes';
</script>
<Router routes={routes} />
Code of Conduct
Please note that this project is released with a Contributor Code of Conduct). By participating in this project you agree to abide by its terms.