svelte-router-simple

1.0.8 • Public • Published

svelte-router-simple

Installation

yarn add svelte-router-simple

Usage

  import Router from "svelte-router-simple";
 
  const routes = [
    {
      exact: "/", // Specify an exact path match
      component: HomeComponent
    },
    {
      prefix: "/", // Specify a prefix path match, and attempt to match child routes
      component: NotFound, // Used if no child routes match
      routes: [
        { exact: "/videos", component: VideosComponents },
        { exact: "/pictures", component: PicturesComponent },
      ],
    },
  ];
</script>
 
<div id="app">
  <Router {routes} />
</div>

Readme

Keywords

none

Package Sidebar

Install

npm i svelte-router-simple

Weekly Downloads

0

Version

1.0.8

License

ISC

Unpacked Size

4.59 kB

Total Files

17

Last publish

Collaborators

  • flowwwie