反应路由器中hashHistory和browserHistory有什么区别? [英] What is the difference between hashHistory and browserHistory in react router?

查看:170
本文介绍了反应路由器中hashHistory和browserHistory有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了一下,但我没有找到以下问题的明确答案:react-router中的hashHistory和browserHistory有什么区别?

I have googled quite some bit, but I didn't find a clear answer to the following question: What is the difference between hashHistory and browserHistory in react-router?

推荐答案

基本区别在于hashHistory使用以下URL: http:// myurl。 com / #page / another_page / another_page

The basic difference is that the hashHistory uses URLs like: http://myurl.com/#page/another_page/another_page

使用BrowserHistory,您可以获得正常的网址(无哈希):http://myurl.com/page/another_page/another_page

With BrowserHistory you get normal urls (no hash): http://myurl.com/page/another_page/another_page

这篇关于反应路由器中hashHistory和browserHistory有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆