码迷,mamicode.com
首页 > 其他好文 > 详细

react-router跳转传值

时间:2017-06-26 10:30:39      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:get   message   imp   handle   lan   传值   logs   跳转页面   oca   

跳转页面传递参数

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

标签:get   message   imp   handle   lan   传值   logs   跳转页面   oca   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!