From 7049be5947086042161d18c61141e9363a413821 Mon Sep 17 00:00:00 2001 From: Christof Leuenberger Date: Wed, 12 Jul 2017 11:45:17 +0200 Subject: [PATCH 1/2] Update redirect-and-alias.md Added note about navigation guards not being applied on redirects. Background: I just tried doing a conditional redirect where I rely on user data being loaded into the vuex store by the route guards. But since they are only applied after the redirect (on the actual route that you are being redirected to), the data was never there. --- docs/en/essentials/redirect-and-alias.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/essentials/redirect-and-alias.md b/docs/en/essentials/redirect-and-alias.md index b23aa95d7..1dd306a56 100644 --- a/docs/en/essentials/redirect-and-alias.md +++ b/docs/en/essentials/redirect-and-alias.md @@ -35,6 +35,8 @@ const router = new VueRouter({ }) ``` +Note that [Navigation Guards](../advanced/navigation-guards.md) are not applied on redirects, only on their targets. + For other advanced usage, checkout the [example](https://github.com/vuejs/vue-router/blob/dev/examples/redirect/app.js). ### Alias From d4fc6385b2b4f3ad11cb9bcf6582c5474087811b Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Sun, 8 Oct 2017 12:27:54 +0200 Subject: [PATCH 2/2] Update redirect-and-alias.md --- docs/en/essentials/redirect-and-alias.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/essentials/redirect-and-alias.md b/docs/en/essentials/redirect-and-alias.md index 601cac7e3..859549bb6 100644 --- a/docs/en/essentials/redirect-and-alias.md +++ b/docs/en/essentials/redirect-and-alias.md @@ -35,7 +35,7 @@ const router = new VueRouter({ }) ``` -Note that [Navigation Guards](../advanced/navigation-guards.md) are not applied on redirects, only on their targets. +Note that [Navigation Guards](../advanced/navigation-guards.md) are not applied on the route that redirects, only on its target. In the example below, adding a `beforeEnter` or `beforeLeave` guard to the `/a` route would not have any effect. For other advanced usage, checkout the [example](https://github.com/vuejs/vue-router/blob/dev/examples/redirect/app.js).