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 = [
6565 {
6666 path: " /movies" ,
6767 component: moviesPage,
68+
69+ // Optional
6870 meta: {
6971 isVertical: true ,
7072 // Example actions to dispatch automatically when page is visited
@@ -80,6 +82,18 @@ const routes = [
8082 showNavigationButtons: null ,
8183 },
8284 },
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+ },
8397 },
8498];
8599
@@ -105,7 +119,7 @@ const router = createRouter(
105119
106120 // Do something straight before navigation or adjust NS routing settings
107121 routeBackCallback : (_to , options ) => {
108- //
122+ // Do something...
109123 },
110124
111125 // Set Vue Instance (Vue.prototype by default)
You can’t perform that action at this time.
0 commit comments