2022-04-06 05:56:08 +00:00
|
|
|
# `abortNavigation`
|
|
|
|
|
2022-04-07 13:46:30 +00:00
|
|
|
```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).
|
2022-04-06 05:56:08 +00:00
|
|
|
::
|
|
|
|
|
2022-04-07 13:46:30 +00:00
|
|
|
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"}
|
2022-04-06 05:56:08 +00:00
|
|
|
::
|