angular+ionic项目打包后,访问页面空白。错误信息Error: Cannot match any routes. URL Segment: ‘index.html‘ at t.value
项目中遇到此问题,研究了很久。最终解决,一开始以为是路由配置错误。
在app.module.ts中添加,import{LocationStrategy,HashLocationStrategy}from'@angular/common';
在providers位置添加{provide:LocationStrategy,useClass:HashLocationStrategy}
...
原创
2020-12-31 09:10:58 ·
940 阅读 ·
0 评论