Skip to content

Commit 0c91292

Browse files
committed
docs: note about params type
Close #873
1 parent a11b04f commit 0c91292

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/guide/essentials/navigation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ router.push({ name: 'user', params: { username } }) // -> /user/eduardo
5151
router.push({ path: '/user', params: { username } }) // -> /user
5252
```
5353

54+
When specifying `params`, make sure to either provide a `string` or `number` (or an array of these for [repeatable params](./oute-matching-syntax.md#repeatable-params)). **Any other type (like `undefined`, `false`, etc) will be automatically stringified**. For [optional params](./route-matching-syntax.md#repeatable-params), you can provide an empty string (`""`) as the value to skip it.
55+
5456
Since the prop `to` accepts the same kind of object as `router.push`, the exact same rules apply to both of them.
5557

5658
`router.push` and all the other navigation methods return a _Promise_ that allows us to wait til the navigation is finished and to know if it succeeded or failed. We will talk more about that in [Navigation Handling](../advanced/navigation-failures.md).

0 commit comments

Comments
 (0)