./routers/index.js
<Route path='/list/:id' component={list} />
./index(传值)
serch() {
let id = this.state.searchinput
this.props.history.push(`/list/${id}`);
}
./list(接收值)
this.props.history
可以查看传的所有值
提取,并切割
console.log((this.props.history.location.pathname).split('/')[2]);