docs: highlight the possibility of middleware to return nothing (#24241)

This commit is contained in:
Ewen Quimerc'h 2023-12-14 21:11:38 +01:00 committed by GitHub
parent 3fba516073
commit 16bd1eca1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,7 @@ Unlike [navigation guards](https://router.vuejs.org/guide/advanced/navigation-gu
Possible return values are: Possible return values are:
* nothing - does not block navigation and will move to the next middleware function, if any, or complete the route navigation * nothing (a simple `return` or no return at all) - does not block navigation and will move to the next middleware function, if any, or complete the route navigation
* `return navigateTo('/')` - redirects to the given path and will set the redirect code to [`302` Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302) if the redirect happens on the server side * `return navigateTo('/')` - redirects to the given path and will set the redirect code to [`302` Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302) if the redirect happens on the server side
* `return navigateTo('/', { redirectCode: 301 })` - redirects to the given path and will set the redirect code to [`301` Moved Permanently](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301) if the redirect happens on the server side * `return navigateTo('/', { redirectCode: 301 })` - redirects to the given path and will set the redirect code to [`301` Moved Permanently](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301) if the redirect happens on the server side
* `return abortNavigation()` - stops the current navigation * `return abortNavigation()` - stops the current navigation