📝 fix example bug in doc demo (#2234)

This commit is contained in:
张雨涵 2022-09-22 19:44:46 +08:00 committed by GitHub
parent 07bd541880
commit 3a365382da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -679,10 +679,10 @@ const childrenPath = ['/app1', '/app2'];
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (to.name) { if (to.name) {
// There is a name attribute, indicating that it is the route of the main project // There is a name attribute, indicating that it is the route of the main project
next(); return next();
} }
if (childrenPath.some((item) => to.path.includes(item))) { if (childrenPath.some((item) => to.path.includes(item))) {
next(); return next();
} }
next({ name: '404' }); next({ name: '404' });
}); });

View File

@ -687,10 +687,10 @@ const childrenPath = ['/app1', '/app2'];
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (to.name) { if (to.name) {
// 有 name 属性,说明是主应用的路由 // 有 name 属性,说明是主应用的路由
next(); return next();
} }
if (childrenPath.some((item) => to.path.includes(item))) { if (childrenPath.some((item) => to.path.includes(item))) {
next(); return next();
} }
next({ name: '404' }); next({ name: '404' });
}); });