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

fix: 修复anchorNav组件定位不准问题 #10219

Merged
merged 1 commit into from
May 13, 2024

Conversation

qkiroc
Copy link
Collaborator

@qkiroc qkiroc commented May 11, 2024

What

原始逻辑是在组件mount和dom tree改变后去计算每个section的高度并记录到数组中,但是会出现section中有图片一类在计算后才改变高度的情况,导致锚点定位不准。

Why

How

现优化为收集每一个section的真实dom,在每次点击菜单或滚动时去实时计算高度

@github-actions github-actions bot added the fix label May 11, 2024
Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@2betop 2betop merged commit 6cd5a59 into baidu:master May 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants