From: Eduardo San Martin Morote Date: Tue, 28 Apr 2020 09:29:35 +0000 (+0200) Subject: docs: onBeforeRoute* X-Git-Tag: v4.0.0-alpha.8~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1761d78474252b6fe0c3fe7ccd7b08bb533d8a96;p=thirdparty%2Fvuejs%2Frouter.git docs: onBeforeRoute* --- 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) {