Dynamic routing
Demo for the dynamic()
function.
The following routes are defined in this page (see source) matched dynamically:
let routes: Array<DynamicRoute> = [
];
<svelte:component this={dynamic($path, routes, Error)} />
Try clicking on them and you'll see the rendered route changing below:
- Dynamic Static Route 1
- Dynamic Static Route 2
- Dynamic Named Param Route: /dynamic/params/62
- Dynamic RegExp Route: /dynamic/re62
- Invalid route (/dynamic/invalid)
Renderized dynamic component:
Dynamic Named Route: /dynamic/params/141
- This route is dynamic
- Matched at path:
/dynamic/params/141
- Defined as:
'/dynamic/params/:param'
- Value ({$params['param']}):
141