时间:2016-08-23 10:55:11
作者:zhongxia
地址:
说明
在SPA中,每个模块的地址,最原始的做法就是使用 hash 形式的地址( 加上一个 # 的地址,浏览器就不会因为 #home 这个变化而去 跳转页面。 因为浏览器会认为跳转到内部某个锚点。 )
import { Router, Route } from 'react-router'
import { createHistory } from 'history'
...
render( <Router history={createHistory()} routes={rootRoute}/>, document.getElementById('root'));
Paste_Image.png