Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 448d3e7

Browse files
authored
feat: Add beforeEnter info to readme
1 parent f9be7d7 commit 448d3e7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

‎README.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /