Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9f95fb7

Browse filesBrowse files
Section about deprecated onDemand and onAbort callback arguments (#2330)
* Added deprecated onDemand and onAbort callback arguments to migration guide The onDemand and onAbort callbacks for router.push and .replace were deprecated in v4. I added a section to the migration guide explaining that users should replace them with the thenable Promise the methods return. * Apply suggestions from code review * Update packages/docs/guide/migration/index.md [skip ci] --------- Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
1 parent 7d1db18 commit 9f95fb7
Copy full SHA for 9f95fb7

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed

‎packages/docs/guide/migration/index.md

Copy file name to clipboardExpand all lines: packages/docs/guide/migration/index.md
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ Given any [normalized route location](/api/#RouteLocationNormalized):
443443

444444
**Reason**: This allows to easily copy existing properties of a location when calling `router.push()` and `router.resolve()`, and make the resulting route location consistent across browsers. `router.push()` is now idempotent, meaning that calling `router.push(route.fullPath)`, `router.push({ hash: route.hash })`, `router.push({ query: route.query })`, and `router.push({ params: route.params })` will not create extra encoding.
445445

446+
### `$router.push()` and `$router.replace()` - `onComplete` and `onAbort` callbacks
447+
448+
Previously, `$router.push()` and `$router.replace()` accepted two callbacks, `onComplete` and `onAbort`, as second and third arguments. They were called after a navigation based on the result. With the introduction of a Promise based API, these callbacks are redundant and have been removed. See [Navigation Failures](/guide/advanced/navigation-failures.md) for more information on how to detect successful and failed navigations.
449+
450+
**Reason**: Reduce library size by adapting to established JS standards (Promises).
451+
446452
### TypeScript changes
447453

448454
To make typings more consistent and expressive, some types have been renamed:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.