SAP UI5 Web Component React应用如何在
2020-02-09 本文已影响0人
华山令狐冲
假设我要从React的home Component跳转到detail Component.
在home Component里,定义一个点击事件处理函数:
![](https://img.haomeiwen.com/i2085791/e75481c56eeaaaa7.png)
其实现源代码如下:
![](https://img.haomeiwen.com/i2085791/b69ad45571850a74.png)
const history = useHistory();
const handleProgressHeaderClick = () => {
history.push("/detail");
};
测试:点击Progress list后,注意观察url和显示区域的变化:
![](https://img.haomeiwen.com/i2085791/aad04e98d4304713.png)
![](https://img.haomeiwen.com/i2085791/773a1a1ccaf7e68c.png)
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
![](https://img.haomeiwen.com/i2085791/fc7ecd97deb67090.png)