手机网站开发成app,做qq头像的网站,北京购物网站建设,蛋糕教做网站目录
一、push跳转
1、Link组件#xff1a;
二、replace跳转 三、goBack跳转#xff08;回退#xff09; 四、goForward跳转#xff08;前进#xff09; 五、 go跳转#xff08;向前或向后跳转指定步数#xff09; 一、push跳转 1、Link组件#xff1a; 可以在不刷新…
目录
一、push跳转
1、Link组件
二、replace跳转 三、goBack跳转回退 四、goForward跳转前进 五、 go跳转向前或向后跳转指定步数 一、push跳转 1、Link组件 可以在不刷新页面的情况下进行跳转会渲染一个a标签to属性是跳转的路径exact表示精确匹配 import { Link } from react-router-dom;
import { Link } from apollo/router // 其他项目里的用法// 在组件中使用 Link 创建导航链接
// 1、标签式跳转不传参
Link to/financeMangeView待办/Link// 2、标签式跳转params传参
Link to{/financeMangeView/detail/${item.id}/${item.title}}待办/Link
Link to/financeMangeView/detail/01/信息1信息/Link// 编程时跳转不传参
this.props.history.push(/home/detail)// 编程时跳转state传参
this.props.history.push(/home/detail,{id:01,title:信息1})二、replace跳转 // 标签式跳转不传参
Link replace to/home/detail/信息/Link// 标签式跳转params传参
Link replace to/home/detail/01/信息1信息/Link// 编程时跳转不传参
this.props.history.replace(/home/detail)// 编程时跳转state传参
this.props.history.replace(/home/detail,{id:01,title:信息1})三、goBack跳转回退 this.props.history.goBack()四、goForward跳转前进 this.props.history.goForward()五、 go跳转向前或向后跳转指定步数 this.props.history.go(num)