Skip to content

navbar has problems with activematch #4332

Open
@BlazeSnow

Description

@BlazeSnow

Describe the bug

无论在Examples的activematch输入任何内容,test被高亮时,Examples总是会高亮。

Whenever you enter anything in the Examples' activematch, the Examples will always be highlighted when test is highlighted.

      {
        text: 'Examples',
        activeMatch: '/whatever/',
        items: [
          {
            text: 'test',
            activeMatch: '/test/',
            link: '/test/',
          },
          {
            text: 'another',
            activeMatch: '/another/',
            link: '/another/',
          }
        ]
      },

Reproduction

https://blazesnow-vitepressissue.vercel.app/

https://github.com/BlazeSnow/VitepressIssue

Expected behavior

最上一级的activematch应当匹配组内的activematch,而不是输入任何值都可以使最上一级的activematch高亮。

The uppermost level of activematch should match the activematch in the group, rather than entering any value that will make the uppermost level of activematch highlighted.

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 6.28 GB / 15.69 GB
  Binaries:
    Node: 23.1.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (129.0.2792.65)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    vitepress: ^1.4.2 => 1.4.3

Additional context

No response

Validations

  • Check if you're on the latest VitePress version.
    Follow our Code of Conduct
    Read the docs.
    Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @BlazeSnow

      Issue actions

        navbar has problems with activematch · Issue #4332 · vuejs/vitepress