ng-docs / ng-docs.github.io

Angular 官方文档中文版预编译网站
https://angular.cn
Other
104 stars 22 forks source link

路由策略 #147

Open Paul-Yellow opened 4 years ago

Paul-Yellow commented 4 years ago

问题: 开发环境中路由是history模式,但是打包到生产环境中路由竟然成了hash的模式。但是angular模式 默认的是history模式啊,为什么到了线上成了hash了呢?我看了Nginx的配置是最基础的配置,没有针对history模式路由进行配置。但是问题是应该404 不应该直接是hash的模式啊?是不是我少配置了什么东西了?

版本: angular9 ng-zorro

wszgrcy commented 4 years ago

可以在stackblitz上代码...最小化的那种 或者手动强制指定一次?https://angular.cn/guide/router#locationstrategy-and-browser-url-styles