vuepress / vuepress-community

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

Table of contents plugin should play nicely with @vuepress/active-header-links #69

Closed swaylock closed 3 years ago

swaylock commented 3 years ago

What problem does the feature solve?

When I embed the TOC component directly into the sidebar of my application using the following notation:

<TOC />

The table of contents is rendered as expected. However, the classes on the TOC items are not being updated with the "active" class when you scroll.

Proposed solution

I've tried the following in the plugin config:

    [
      "@vuepress/active-header-links",
      {
        sidebarLinkSelector: "div.toc-menu li a",
      },
    ],

But that doesn't work.

I wonder if we were to (optionally) add the sidebar-link class to the toc items, that may just solve it...

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.