在我构建 Angular 17 项目并将其上传到托管后,当我在页面上按 F5 时,它会重定向到 404 页面。我无法在 Angular 17 中解决这种情况。
我可以毫无问题地查看我划掉的组件,但是当我在该页面上按 F5 时,它会将我发送到 404 页面。
根据我研究的资源,我应该使用LocationStrategy和HashLocationStrategy,但我不知道如何在Angular 17中使用它。
截图:
app.routes.ts
app.config.ts
您的index.html 文件中有什么?