diff --git a/docs/faq/README.md b/docs/faq/README.md index a497838..2afe378 100644 --- a/docs/faq/README.md +++ b/docs/faq/README.md @@ -679,10 +679,10 @@ const childrenPath = ['/app1', '/app2']; router.beforeEach((to, from, next) => { if (to.name) { // 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))) { - next(); + return next(); } next({ name: '404' }); }); diff --git a/docs/faq/README.zh.md b/docs/faq/README.zh.md index 56a9b77..5d0f98f 100644 --- a/docs/faq/README.zh.md +++ b/docs/faq/README.zh.md @@ -687,10 +687,10 @@ const childrenPath = ['/app1', '/app2']; router.beforeEach((to, from, next) => { if (to.name) { // 有 name 属性,说明是主应用的路由 - next(); + return next(); } if (childrenPath.some((item) => to.path.includes(item))) { - next(); + return next(); } next({ name: '404' }); });