From f3b3bd7e8d8dc0a9c0711ecdb8227b7e4da918f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99?= <615206459@qq.com> Date: Thu, 1 Aug 2024 00:57:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cool/router/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cool/router/index.ts b/src/cool/router/index.ts index 156e7f6..705cf04 100644 --- a/src/cool/router/index.ts +++ b/src/cool/router/index.ts @@ -51,6 +51,11 @@ router.onError((err: Error) => { ElMessage.error(`页面存在错误:${err.message}`); console.error(err); + // 动态加载组件错误,刷新页面 + if (err.message?.includes("Failed to fetch dynamically imported module")) { + window.location.reload(); + } + setTimeout(() => { lock = false; }, 0);