前言
本文主要給大家介紹了關于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)
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對武林網的支持。
新聞熱點
疑難解答