docs(api): add abortNavigation docs (#4164)

This commit is contained in:
Clément Ollivier 2022-04-07 15:46:30 +02:00 committed by GitHub
parent 6205fbe316
commit f69a67472a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,16 @@
# `abortNavigation` # `abortNavigation`
```ts
abortNavigation(err?: Error | string): false
```
* **err**: Optional error to be thrown by `abortNavigation()`.
::alert{type="warning"}
`abortNavigation()` is only usable inside a [route middleware handler](/guide/directory-structure/middleware).
::
Inside a route middleware handler, `abortNavigation()` will abort navigation, and throw an error if one is set as a parameter.
::ReadMore{link="/guide/features/routing"} ::ReadMore{link="/guide/features/routing"}
:: ::
::NeedContribution
::