From 3a365382da884d7e9b534580d001ee5f9682a8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=9B=A8=E6=B6=B5?= Date: Thu, 22 Sep 2022 19:44:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20fix=20example=20bug=20in=20doc?= =?UTF-8?q?=20demo=20(#2234)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/faq/README.md | 4 ++-- docs/faq/README.zh.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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' }); });