From 8a98bfe0b93b48d3eac0103c7acd3a220ab6c0bf Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Sat, 2 Apr 2022 15:57:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20index.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 5d8edf9..4be6330 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,7 +11,8 @@ const routes = [ { path: "/demo", name: "demo", - component: import('@/views/demo.vue').then(e=>{ // 引入文件路径错误,会导致不能热更新 + // 必须用工厂化函数方式返回,否则打包后变空白 + component: ()=>import('@/views/demo.vue').then(e=>{ // 引入文件路径错误,会导致不能热更新 e.default.name='demo' //组件命名 return e }),