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

使用NAnchor点击滚动到位置时,高亮的元素为被点击元素的上一个元素 #6428

Open
5 tasks done
SugrSertraline opened this issue Oct 3, 2024 · 0 comments
Labels
untriaged need to sort

Comments

@SugrSertraline
Copy link

SugrSertraline commented Oct 3, 2024

描述错误

我使用了NAnchor组件,我的渲染方式是动态的,分为多个Seciton,每个Section有唯一ID,并将他们赋值给NAnchor的每个Link。
假设我点击了Section2,那么元素滚动到Section2,并将其最上边固定在页面的最上面,但是高亮的部分显示的却是在Section1,我想要在滚动时滚动距离多加1个最小单位,否则高亮的元素为被点击元素的上一个元素。

复现步骤

1.点击侧边导航
2.滚动到被点击元素
3.高亮为被点击元素的上一个元素

最小复现链接

https://github.com/SugrSertraline/neu-wiki

系统信息

[email protected] | MIT | deps: 19 | versions: 144
A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast
https://www.naiveui.com
keywords: naive-ui, component library, ui framework, ui, vue
dist
.tarball: https://registry.npmjs.org/naive-ui/-/naive-ui-2.40.1.tgz
.shasum: 64d9570dae4286b89979a582713f6f824c25230b
.integrity: sha512-3NkL+vLRQZKQxCHXa+7xiD6oM74OrQELaehDkGYRYpr6kjT+JJB+Z7h+5LC70gn8VkbgCAETv0+uRWF+6MLlgQ==
.unpackedSize: 30.7 MB
dependencies:
@css-render/plugin-bem: ^0.15.14 @types/lodash: ^4.14.198         date-fns-tz: ^3.1.3              lodash-es: ^4.17.21              vdirs: ^0.1.8
@css-render/vue3-ssr: ^0.15.14   async-validator: ^4.2.5          date-fns: ^3.6.0                 lodash: ^4.17.21                 vooks: ^0.2.12
@types/katex: ^0.16.2            css-render: ^0.15.14             evtd: ^0.2.4                     seemly: ^0.3.8                   vueuc: ^0.4.63
@types/lodash-es: ^4.17.9        csstype: ^3.1.3                  highlight.js: ^11.8.0            treemate: ^0.3.11
maintainers:
- 07akioni <[email protected]>
dist-tags:
beta: 2.32.2-beta.0  latest: 2.40.1
borowsers:Chrome

使用的包管理器

npm

验证

@SugrSertraline SugrSertraline added the untriaged need to sort label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged need to sort
Projects
None yet
Development

No branches or pull requests

1 participant