Skip to content

Commit

Permalink
docs: indicate navigateTo options are optional (nuxt#9672)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroVolodymyrson authored Dec 12, 2022
1 parent b3ccec3 commit 2a2f21b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default defineNuxtRouteMiddleware((to, from) => {

Nuxt provides two globally available helpers that can be returned directly from the middleware:

1. `navigateTo (to: RouteLocationRaw | undefined | null, options: { replace: boolean, redirectCode: number, external: boolean )` - Redirects to the given route, within plugins or middleware. It can also be called directly to perform page navigation.
1. `navigateTo (to: RouteLocationRaw | undefined | null, options?: { replace: boolean, redirectCode: number, external: boolean )` - Redirects to the given route, within plugins or middleware. It can also be called directly to perform page navigation.
2. `abortNavigation (err?: string | Error)` - Aborts the navigation, with an optional error message.

Unlike navigation guards in [the vue-router docs](https://router.vuejs.org/guide/advanced/navigation-guards.html#global-before-guards), a third `next()` argument is not passed, and redirects or route cancellation is handled by returning a value from the middleware. Possible return values are:
Expand Down

0 comments on commit 2a2f21b

Please sign in to comment.