问题
修改.vue文件后,浏览器控制台提示下面这个错误,并且页面并没有热更新。
ReferenceError: Cannot access 'xxx' before initialization
[hmr] Failed to reload xxx. This could be due to syntax errors or importing non-existent modules. (see errors above)
解决办法
路由配置的导入模块方式改为动态导入路由方式
component: () => import("../components/menu/Menu.vue")