Skip to content

Commit

Permalink
docs: note about params type
Browse files Browse the repository at this point in the history
Close #873
  • Loading branch information
posva committed Jun 14, 2021
1 parent a11b04f commit 0c91292
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/guide/essentials/navigation.md
Expand Up @@ -51,6 +51,8 @@ router.push({ name: 'user', params: { username } }) // -> /user/eduardo
router.push({ path: '/user', params: { username } }) // -> /user
```

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.

Since the prop `to` accepts the same kind of object as `router.push`, the exact same rules apply to both of them.

`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).
Expand Down

0 comments on commit 0c91292

Please sign in to comment.