-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(router): 修复h5页面onShow时onReachBottom事件多次触发的问题 #12453
Conversation
14 similar comments
看起来并不能修复该问题🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个问题应该是 page 中 show 方法多调用了一次 bindPageEvents 导致的 (load 中已经调用过
在page show中再次调用bindPageEvents是修复H5端onPageScroll不触发的问题 bindPageEvents在解绑时的函数引用发生了改变,导致了解绑无效。 比如从A页面跳转到B页面时,pageScrollFn已经被重新赋值为B页面时创建的函数引用,后退到A页面时解绑的是B页面的pageScrollFn,解绑不成功,这才导致多次触发onReachBottom。 我这次改动是将绑定函数与页面关联起来,在解绑时才可以取到正确的函数引用做解绑。 |
你说的对 |
@KkZsc 老哥,测试用例还需要更新一下 |
已更新 |
这个 PR 做了什么? (简要描述所做更改)
修复 #11504
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台: