mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
docs: indicate navigateTo
options are optional (#9672)
This commit is contained in:
parent
b3ccec3d87
commit
2a2f21b84f
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user