BrowserRouter:

  原理是H5的history API,IE9及以下不兼容,需要由web server支持,在web client这边window.location.pathname被react router解析,example.com/react/route

HashRouter:

  原理是URL的hash,不需要由web server支持,因为它的只有‘/’path需要由web server支持,而#/react/route URL不能被web server读取,在web client这边window,location.hash被react router解析,example.com/#/react/route

相关文章:

  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2021-05-10
猜你喜欢
  • 2021-04-07
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案