首页 > 代码库 > react-router跳转传值

react-router跳转传值

跳转页面传递参数

1.引入包 
import {hashHistory} from ‘React-router’

2.跳转传值

    handleClick = (value) => {        hashHistory.push({            pathname: ‘message/detailMessage‘,            query: {                title:value.title,                time:value.time,                text:value.text            },        })    }

3.接收值

console.info(this.props.location.query.title)console.info(this.props.location.query.time)console.info(this.props.location.query.text)

 

转载自:http://blog.csdn.net/sweiqin/article/details/60776603

react-router跳转传值