From 793e740c324e9240b8331ce5866381593c8c0691 Mon Sep 17 00:00:00 2001 From: kangert Date: Thu, 17 Jun 2021 10:32:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8F=90=E9=AB=98=E7=BC=96=E7=A0=81=E4=BD=93?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 6c0f0a1..85a1fe9 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -858,7 +858,7 @@ const pathMatch = { }; // 获取目录下的 .vue 全部文件,参考 vite:import.meta.glob -const dynamicViewsModules = import.meta.glob('../views/**/*.{vue,tsx}'); +const dynamicViewsModules: Record = import.meta.glob('../views/**/*.{vue,tsx}'); // 添加静态路由 const router = createRouter({ @@ -919,7 +919,7 @@ export function backEndRouter(routes: any) { } // 后端控制路由,后端路由 component 转换函数 -export function dynamicImport(dynamicViewsModules: Record Promise<{ [key: string]: any }>>, component: string) { +export function dynamicImport(dynamicViewsModules: Record, component: string) { const keys = Object.keys(dynamicViewsModules); const matchKeys = keys.filter((key) => { const k = key.replace('../views', '');