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 }),