Vue Router / React Router 两种模式
vue: history & hash
react: BrowserRouter & HashRouter
这两种模式在 react 与 vue 中表达方式不同,但表现形式是一样的
history : 对应 url 表现为 http://abc.example.com/aa/bb/cc/dd 但需要 nginx 服务做路由重定向到跟路径 原理: popstate 事件 在 history.back history.forward history.go会触发
hash : 对应 url 表现为 http://abc.example.com/#/aa/bb/cc/dd 原理: onhashchange 事件