react-router跳转传值
来源:互联网 发布:双头螺纹怎么编程 编辑:程序博客网 时间:2024/06/05 07:47
跳转页面传递参数
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)
4.如果使用的ant design,可以在model里面获取结果,当然也可以在组件里面获取结果
组件页面获取结果的写法为:
import {hashHistory} from 'react-router';hashHistory.listen(location => { //获取传递的数据,对象、值.... console.log(location.query); // 获取路径 console.log(location.pathname); }})
阅读全文
0 0
- react-router跳转传值
- react-router跳转传值
- [React]react-router跳转传值
- React笔记(一):react-router跳转传值
- React-Router传参取值页面跳转
- ReactNative React-native-router-flux框架---页面跳转与传值
- react-router 4.2.0<link>页面跳转-传参与不传参
- react-router JS 控制路由跳转
- React-router表单跳转两种方法
- react-router 路由控制页面跳转
- vue router-link跳转传值示例
- react入门之路由----react-router的跳转问题
- React页面利用this.context.router.push跳转传参的接收方法
- React Js Router 静态方法跳转 直接点到组件
- react-router带参数使用Link跳转并取出参数
- react-router v4 使用 history 控制路由跳转
- ReactJS与antdDesign中页面跳转问题(React Router)
- react +webpack+express router实现登录与页面跳转
- Hibernate--级联删除
- WCF是什么
- 搜索——水池数目
- 文本区的DucumentEvent事件
- Cannot find KieModule(jbpm-console错误)
- react-router跳转传值
- oracle sql脚本批量执行
- ZooKeeper原理及其在Hadoop和HBase中的应用
- js 插入和添加节点
- flask 应用的架构和部署(flask+gunicorn+nginx)
- SAP ABAP OVS 開發步驟
- win7系统安装--记录备忘
- 常用的CSS样式
- ThinkPHP的输出和模型使用