Skip to content

Commit 5084278

Browse files
author
David Horak
committed
Update readme.md
1 parent 278f661 commit 5084278

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

readme.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ To see the details code documentation, please read the [Code Documentation](http
5050
- [go](#go)
5151
- [routeURL](#routeurl)
5252
- [navigationGuard](#navigationguard)
53+
- [onBeforeNavigation](#onbeforenavigation)
5354
- [onNavigationChanged](#onnavigationchanged)
5455
- [onError](#onerror)
5556
- [Location Object](#location-object)
@@ -623,6 +624,24 @@ Parameters:
623624
624625
to, from are [Route Object](#route-object).
625626
627+
#### onBeforeNavigation
628+
Register a callback which will be called before execution of navigation guards.
629+
```javascript
630+
const unregister = $router.onBeforeNavigation(callback);
631+
632+
// To unregister the event:
633+
unregister();
634+
unregister = null;
635+
636+
```
637+
Parameters:
638+
639+
| Name | Description | Type |
640+
| :----------- | :---------------------------------------- | :------------------------------------ |
641+
| callback | callback function with fn(to, from) signature. | function |
642+
643+
to, from are [Route Object](#route-object).
644+
626645
#### onNavigationChanged
627646
Register a callback which will be called when all navigation guards are resolved, and the final navigation change is resolved.
628647
```javascript

0 commit comments

Comments
 (0)