Root.js
const Root = () => (
<HashRouter>
<div>
<Route exact path="/" component={Main}/>
<Route path="/main/:page" component={Main}/>
<Route path="/detail/:name" component={Detail}/>
</div>
</HashRouter>
);
export default Root;
MainList in ItemList.js
render() {
let count = 0;
return (
<div>
{this.state.data.map(function (data, i) {
count++;
return <Item data={data} key={count} order={count}/>;
})}
</div>
);
}
项目滚动到底部(更多视图)附加数据(使用ajax)
项目点击链接到= {item idx}并转到详细信息页面
并返回页面..重置dom!
如何保存dom?!?