Closed dumptyd closed 3 years ago
Clicking on TOC links doesn't scroll the page to the specified anchor.
Render a TOC using the TOC component and click on any of the links.
N/A
Should scroll the page to the specified anchor
I think setting hash here instead of to would do the trick. https://github.com/vuepress/vuepress-community/blob/main/packages/vuepress-plugin-table-of-contents/src/components/TableOfContents.ts#L78
hash
to
Huh, I checked the route object and it's correct. I think it's happening because window isn't the scrolling element in my page. Closing this.
window
Environment
Describe the bug
Clicking on TOC links doesn't scroll the page to the specified anchor.
Steps To Reproduce
Render a TOC using the TOC component and click on any of the links.
Screenshots
N/A
Expected behavior
Should scroll the page to the specified anchor
Additional context
I think setting
hash
here instead ofto
would do the trick. https://github.com/vuepress/vuepress-community/blob/main/packages/vuepress-plugin-table-of-contents/src/components/TableOfContents.ts#L78