]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: typo (#714)
authorDawaxy <37327614+Missmisery@users.noreply.github.com>
Tue, 12 Jan 2021 15:51:05 +0000 (23:51 +0800)
committerGitHub <noreply@github.com>
Tue, 12 Jan 2021 15:51:05 +0000 (16:51 +0100)
I think it's wrong here :router.push('/admin').push(failure);
router.push return promise instance, push should be replaced with then.

docs/guide/advanced/navigation-failures.md

index e2ae0fc8ddb00ae6336fa950279f907f90d741e6..e9247c332bbd2c6c3b7d319951a16fb34305da79 100644 (file)
@@ -71,7 +71,7 @@ All navigation failures expose `to` and `from` properties to reflect the current
 
 ```js
 // trying to access the admin page
-router.push('/admin').push(failure => {
+router.push('/admin').then(failure => {
   if (isNavigationFailure(failure, NavigationFailureType.redirected)) {
     failure.to.path // '/admin'
     failure.from.path // '/'