]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
doc: remove extra brackets (#575)
authorBuddy <aying.zhuai@qq.com>
Fri, 6 Nov 2020 08:08:24 +0000 (16:08 +0800)
committerGitHub <noreply@github.com>
Fri, 6 Nov 2020 08:08:24 +0000 (09:08 +0100)
docs/guide/advanced/navigation-failures.md

index 1244c39139c235ed2011018ad1482010648a5f3d..237e8a6c02e5a5981870516d5553f02521b2ccd0 100644 (file)
@@ -46,11 +46,11 @@ import { NavigationFailureType, isNavigationFailure } from 'vue-router'
 
 // trying to leave the editing page of an article without saving
 const failure = await router.push('/articles/2')
-  if (isNavigationFailure(failure, NavigationFailureType.aborted)) {
-    // show a small notification to the user
-    showToast('You have unsaved changes, discard and leave anyway?')
-  }
-})
+
+if (isNavigationFailure(failure, NavigationFailureType.aborted)) {
+  // show a small notification to the user
+  showToast('You have unsaved changes, discard and leave anyway?')
+}
 ```
 
 ::: tip