File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ const routes = [
65
65
{
66
66
path: " /movies" ,
67
67
component: moviesPage,
68
+
69
+ // Optional
68
70
meta: {
69
71
isVertical: true ,
70
72
// Example actions to dispatch automatically when page is visited
@@ -80,6 +82,18 @@ const routes = [
80
82
showNavigationButtons: null ,
81
83
},
82
84
},
85
+
86
+ // Optional, per route guards are supported
87
+ // More info: https://next.router.vuejs.org/guide/advanced/navigation-guards.html#per-route-guard
88
+ beforeEnter : (to , from ) => {
89
+ if (to .props .passUser ) {
90
+ // Continue navigation
91
+ return true ;
92
+ }
93
+
94
+ // Reject the navigation
95
+ return false ;
96
+ },
83
97
},
84
98
];
85
99
@@ -105,7 +119,7 @@ const router = createRouter(
105
119
106
120
// Do something straight before navigation or adjust NS routing settings
107
121
routeBackCallback : (_to , options ) => {
108
- //
122
+ // Do something...
109
123
},
110
124
111
125
// Set Vue Instance (Vue.prototype by default)
You can’t perform that action at this time.
0 commit comments