You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/advanced/navigation-guards.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,12 +61,12 @@ Finally, you can directly define route navigation guards inside route components
61
61
```js
62
62
constFoo= {
63
63
template:`...`,
64
-
beforeRouteEnter (route, redirect, next) =>{
64
+
beforeRouteEnter (route, redirect, next) {
65
65
// called before the route that renders this component is confirmed.
66
66
// does NOT have access to `this` component instance,
67
67
// because it has not been created yet when this guard is called!
68
68
},
69
-
beforeRouteLeave (route, redirect, next) =>{
69
+
beforeRouteLeave (route, redirect, next) {
70
70
// called when the route that renders this component is about to
71
71
// be navigated away from.
72
72
// has access to `this` component instance.
@@ -79,7 +79,7 @@ The `beforeRouteEnter` guard does **NOT** have access to `this`, because the gua
79
79
However, you can access the instance by passing a callback to `next`. The callback will be called when the navigation is confirmed, and the component instance will be passed to the callback as the argument:
0 commit comments