前端路由的两种实现样式和react-router的机制

前端路由分两种,一种是通过html5的api实现的,history.pushState和history.replaceState,会触发popstate事件

另外一种是通过改变hash来实现,触发hashchange事件。url中带上#