Skip to content

Commit cf5349f

Browse files
committed
chore: better docs
1 parent 676b8ad commit cf5349f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

packages/docs/guide/advanced/typed-routes.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,28 @@ export interface RouteNamedMap {
2020
'home',
2121
// this is the path, it will appear in autocompletion
2222
'/',
23-
// these are the raw params. In this case, there are no params allowed
23+
// these are the raw params (what can be passed to router.push() and RouterLink's "to" prop)
24+
// In this case, there are no params allowed
2425
Record<never, never>,
25-
// these are the normalized params
26+
// these are the normalized params (what you get from useRoute())
2627
Record<never, never>,
27-
// this is a union of all children route names
28+
// this is a union of all children route names, in this case, there are none
2829
never
2930
>
30-
// repeat for each route..
31+
// repeat for each route...
3132
// Note you can name them whatever you want
3233
'named-param': RouteRecordInfo<
3334
'named-param',
3435
'/:name',
35-
{ name: string | number }, // raw value
36-
{ name: string }, // normalized value
36+
{ name: string | number }, // Allows string or number
37+
{ name: string }, // but always returns a string from the URL
3738
'named-param-edit'
3839
>
3940
'named-param-edit': RouteRecordInfo<
4041
'named-param-edit',
4142
'/:name/edit',
42-
{ name: string | number }, // raw value
43-
{ name: string }, // normalized value
43+
{ name: string | number }, // we also include parent params
44+
{ name: string },
4445
never
4546
>
4647
'article-details': RouteRecordInfo<

0 commit comments

Comments
 (0)