SAP UI5 Web Component React应用如何在Component之间跳转
2020-02-17 05:22
399 查看
假设我要从React的home Component跳转到detail Component.
在home Component里,定义一个点击事件处理函数:
其实现源代码如下:
const history = useHistory(); const handleProgressHeaderClick = () => { history.push("/detail"); };
测试:点击Progress list后,注意观察url和显示区域的变化:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- SAP UI5 Web Component不同React页面的跳转实现
- SAP UI5 Web Component的React表格控件用法
- SAP UI5 Web Component里最简单的React列表控件的用法
- SAP UI5 Web Component for React的图标和图片处理
- 如何实现SAP UI5 Web Component React控件的加载效果
- 如何使用SAP UI5 web Component的React框架的柱状图和折线图
- 如何使用SAP UI5 Web Component for React的padding功能
- SAP UI5 web Com 4000 ponent的React组件,如何实现事件响应
- 012、Project Reactor
- 使用 React-Sketchapp
- react
- react 入门
- React入门Today.2(JSX、元素渲染)
- React入门Today.3(组件与Props)
- React入门Today.4(State与生命周期)
- React入门Today.5(事件处理与条件渲染)
- react路由时,不能正常渲染,需要刷新,才能渲染
- React脚手架安装及环境变量解析
- 《React设计模式+最佳实践》最新
- React UI 库:React Suite 3.4.5 版本更新