Skip to content

[Bug] breadcrumb's active state not working #4771

@zhaolinlau

Description

@zhaolinlau

Environment



Is this bug related to Nuxt or Vue?

Nuxt

Version

v4.0.3

Reproduction

  1. add a breadcrumb
<UBreadcrumb
        :items="[
          {
            label: 'UXHMAC',
            to: '/lucky-draw',
            active: route.path == '/lucky-draw',
          },
          {
            label: 'Leaderboard',
            to: '/lucky-draw/leaderboard',
            active: route.path == '/lucky-draw/leaderboard',
          },
          {
            label: 'My Profile',
            to: '/lucky-draw/profile',
            active: route.path == '/lucky-draw/profile',
          },
          {
            label: 'My Rewards',
            to: '/lucky-draw/rewards',
            active: route.path == '/lucky-draw/rewards',
          },
          ...(user?.role == 'service_role'
            ? [
                {
                  label: 'Manage Users',
                  to: '/lucky-draw/admin/users',
                  active: route.path == '/lucky-draw/admin/users',
                },
                {
                  label: 'Manage Gifts',
                  to: '/lucky-draw/admin/gifts',
                  active: route.path == '/lucky-draw/admin/gifts',
                },
                {
                  label: 'Manage Rewards',
                  to: '/lucky-draw/admin/rewards',
                  active: route.path == '/lucky-draw/admin/rewards',
                },
                {
                  label: 'Settings',
                  to: '/lucky-draw/settings',
                  active: route.path == '/lucky-draw/settings',
                },
              ]
            : []),
        ]"
      />
  1. navigate to /lucky-draw/leaderboard
  2. the leaderboard breadcrumb item should be now in active state, but it's not working

Description

The leaderboard should be in active state but it's not, the last item always in active state

Image Image

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting initial review and prioritizationv3#1289

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions