首页 > 其他 > 详细

react-router跳转传值

时间:2017-06-26 09:15:21      阅读:197      评论:0      收藏:0      [点我收藏+]

跳转页面传递参数

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跳转传值

原文:http://www.cnblogs.com/mabylove/p/7078987.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!