react路由跳转传递第二个参数并获取 | 您所在的位置:网站首页 › reactnative路由跳转 › react路由跳转传递第二个参数并获取 |
路由跳转this.props.history.push(''); export default class IndexView extends React.Component { route = () => { this.props.history.push('/my/login',{ data:111 }); console.log("跳转成功!"); } render() { return ( {this.route()}} value = "登录"/> ) } }/my/login.jsx页面: render() { console.log(this.props.location.state.data); return (欢迎登录 ) }打印结果: ? ? |
CopyRight 2018-2019 实验室设备网 版权所有 |