【问题标题】:Angular2 IE adds additional slashes to URL after base pathAngular2 IE 在基本路径之后向 URL 添加了额外的斜杠
【发布时间】:2016-08-14 14:14:12
【问题描述】:

例如,当访问http://localhost:3000/main 时,在页面加载后,IE 会添加额外的斜杠:http://localhost:3000///main/ 所以当我刷新页面后出现错误:

例外:错误:未捕获(在承诺中):错误:无法匹配任何 路线:'/main'

有没有办法在 IE 中配置这个路径? Chrome 运行良好,无需更改 URL。此外,Firefox 43 也很奇怪,因为它在刷新页面后添加了 /\ (http://localhost:3000/\main/)

【问题讨论】:

  • 是否存在遇到此问题的特定 Internet Explorer 版本?
  • 或 Microsoft Internet Explorer 11

标签: internet-explorer firefox angular angular2-routing


【解决方案1】:

这个问题的原因是我在 index.html 基本标记上使用了“\”而不是“/”。

这是很好的标签定义: <base href="/"/>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-22
    • 2021-06-07
    • 1970-01-01
    • 2014-02-08
    • 2015-06-24
    • 2021-03-15
    • 1970-01-01
    相关资源
    最近更新 更多