From 9445f0fbbb232a71cd941a0598e8d651d4f0fdf1 Mon Sep 17 00:00:00 2001 From: iczer <1126263215@qq.com> Date: Fri, 7 Aug 2020 09:46:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20the=20exception=20when=20async=20route?= =?UTF-8?q?=20is=20not=20registered;:star2:=20=E4=BF=AE=E5=A4=8D=EF=BC=9A?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E8=B7=AF=E7=94=B1=E7=BB=84=E4=BB=B6=E6=9C=AA?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=97=B6=E5=AF=BC=E8=87=B4=E7=9A=84=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/routerUtil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/routerUtil.js b/src/utils/routerUtil.js index 0a88cfb..d6a5172 100644 --- a/src/utils/routerUtil.js +++ b/src/utils/routerUtil.js @@ -14,7 +14,7 @@ function parseRoutes(routesConfig, routerMap) { routesConfig.forEach(item => { // 获取注册在 routerMap 中的 router,初始化 routeCfg let router = undefined, routeCfg = {} - if (typeof item === 'string') { + if (typeof item === 'string' && routerMap[item]) { router = routerMap[item] routeCfg = {path: router.path || item, router: item} } else if (typeof item === 'object') {