Skip to content
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

修复固钉组件指定容器固定后外层容器滚动表现异常的问题 #4714

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
2 changes: 2 additions & 0 deletions src/affix/affix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ export default defineComponent({
scrollContainer.value = getScrollContainer(props.container);
on(scrollContainer.value, 'scroll', handleScroll);
on(window, 'resize', handleScroll);
on(window, 'scroll', handleScroll);
binded.value = true;
};

const unbindScroll = () => {
if (!scrollContainer.value || !binded.value) return;
off(scrollContainer.value, 'scroll', handleScroll);
off(window, 'resize', handleScroll);
off(window, 'scroll', handleScroll);
if (rAFId) {
window.cancelAnimationFrame(rAFId);
}
Expand Down
Loading