报错信息
Uncaught SyntaxError: Unexpected token ‘<’ (at chunk-elementUI.aeed1b74.js:1:1)
Uncaught SyntaxError: Unexpected token ‘<’
Uncaught SyntaxError: Unexpected token ‘<’ (at app.570d5057.js:1:1)
背景:路由明明定义正确了,页面跳转也是正常的,但是就是进不去,而且,即使直接在导航栏输入地址也报以上错.尝试了很多其他能够搜索到的方法,但是都不适用我的情况.
解决:
可能是你的路由定义路径"非法",比如说我的就是从
{ path: '/devWorkbench', component: (resolve) => require(['@/views/devWorkbench/index'], resolve), hidden: true, name: 'devWorkbench' },
改成:
{ path: '/WorkbenchDev', component: (resolve) => require(['@/views/devWorkbench/index'], resolve), hidden: true, name: 'WorkbenchDev' },
改完之后就能正常进入了.