vue 和 react 路由跳转和传参

                 

react 

  1 .跳转方式加传参

this.props.history.push({
      //地址
      pathname: '/film/Details',
      //路由传参--对象
      query: {
        id,
        from: ''
      }
    });

  2.跳转Link

import { Link } from 'react-router-dom';

<Link exact="true" to="/login" className="user">
<i className="icon iconfont icon-geren"></i>
</Link>

  

猜你喜欢

转载自www.cnblogs.com/gfweb/p/9803796.html