Skip to content

Commit 968c2a2

Browse files
jsgvposva
authored andcommitted
add beforeRouteUpdate use case to navigation doc (vuejs#1688)
* add beforeRouteUpdate use case to navigation doc * Update navigation.md
1 parent ca4e692 commit 968c2a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: docs/en/essentials/navigation.md

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ The same rules apply for the `to` property of the `router-link` component.
4545

4646
In 2.2.0+, optionally provide `onComplete` and `onAbort` callbacks to `router.push` or `router.replace` as the 2nd and 3rd arguments. These callbacks will be called when the navigation either successfully completed (after all async hooks are resolved), or aborted (navigated to the same route, or to a different route before current navigation has finished), respectively.
4747

48+
**Note:** If the destination is the same as the current route and only params are changing (eg: going from one profile to another `/users/1` -> `/users/2`), you will have to use [beforeRouteUpdate](./dynamic-matching.html#reacting-to-params-changes) to react to changes (eg: fetching the user information).
49+
4850
#### `router.replace(location, onComplete?, onAbort?)`
4951

5052
It acts like `router.push`, the only difference is that it navigates without pushing a new history entry, as its name suggests - it replaces the current entry.

0 commit comments

Comments
 (0)