From 1761d78474252b6fe0c3fe7ccd7b08bb533d8a96 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 28 Apr 2020 11:29:35 +0200 Subject: [PATCH] docs: onBeforeRoute* --- src/navigationGuards.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/navigationGuards.ts b/src/navigationGuards.ts index a5c78ec5..a2e46667 100644 --- a/src/navigationGuards.ts +++ b/src/navigationGuards.ts @@ -22,6 +22,13 @@ import { matchedRouteKey } from './injectionSymbols' import { RouteRecordNormalized } from './matcher/types' import { isESModule } from './utils' +/** + * Add a navigation guard that triggers whenever the current location is + * left. Similarly to {@link beforeRouteLeave}, it has access to the + * component instance as `this`. + * + * @param leaveGuard {@link NavigationGuard} + */ export function onBeforeRouteLeave(leaveGuard: NavigationGuard) { const instance = getCurrentInstance() if (!instance) { @@ -47,6 +54,13 @@ export function onBeforeRouteLeave(leaveGuard: NavigationGuard) { ) } +/** + * Add a navigation guard that triggers whenever the current location is + * updated. Similarly to {@link beforeRouteUpdate}, it has access to the + * component instance as `this`. + * + * @param updateGuard {@link NavigationGuard} + */ export function onBeforeRouteUpdate(updateGuard: NavigationGuard) { const instance = getCurrentInstance() if (!instance) { -- 2.47.3