react 单页面跳转 页面位置 前进页面滚动到顶部 返回页面滚动到上次浏览的位置
react 单页面跳转 页面位置 前进页面滚动到顶部 返回页面滚动到上次浏览的位置
添加以下代码 完美解决
var offsetTop = 0;
var canPoP = true; //push可能会触发pop在这节流
hashHistory.listen(location => {
if (canPoP) {
canPoP = false;
if (locat...
原创
2019-08-16 08:49:06 ·
2796 阅读 ·
3 评论