[React]react-router跳转传值

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chunho/article/details/60776603

跳转

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)
阅读更多

没有更多推荐了,返回首页