vuepress / vuepress-community

:bulb: Community supported ecosystem for VuePress
https://vuepress-community.netlify.app
MIT License
81 stars 62 forks source link

[Bug Report] [table-of-contents] Clicking on TOC links doesn't scroll the page to the specified anchor #87

Closed dumptyd closed 3 years ago

dumptyd commented 3 years ago

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 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

dumptyd commented 3 years ago

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.