svelte-router icon indicating copy to clipboard operation
svelte-router copied to clipboard

change regex pattern for dynamic routes to accept hyphens / underscores

Open alexrdz opened this issue 7 years ago • 1 comments

alexrdz avatar Nov 29 '18 19:11 alexrdz

Sorry I didn't leave much of a message! Anyhow, I just updated the regex pattern to allow dynamic routes like /about/about-us which would look like this in the router config:

const router = new SvelteRouter({
  routes: {
    '/about/:subpage': {
      Component: SubComponent,
      props: {store}
    }
  }
}

Thanks for your consideration! If this isn't within your guidelines, it would be a great feature to have. Thanks again.

alexrdz avatar Nov 30 '18 02:11 alexrdz