您的位置:首页 > Web前端 > React

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的原创文章,请关注公众号"汪子熙":

  • 点赞
  • 收藏
  • 分享
  • 文章举报
汪子熙 博客专家 发布了6646 篇原创文章 · 获赞 639 · 访问量 109万+ 他的留言板 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: