Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

router-link-active class is removed if the route is not exact #2707

Closed
frlinw opened this Issue Apr 11, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@frlinw
Copy link

frlinw commented Apr 11, 2019

Version

3.0.3

Reproduction link

https://codesandbox.io/embed/zrjv12l0rp

Steps to reproduce

  • Click on Home
  • Click on Nested 2

What is expected?

Home should have router-link-active class

What is actually happening?

router-link-active is removed from Home on route change

@posva

This comment has been minimized.

Copy link
Member

posva commented Apr 11, 2019

this is working as expected, the exact prop is what adds that behaviour

@posva posva closed this Apr 11, 2019

@frlinw

This comment has been minimized.

Copy link
Author

frlinw commented Apr 11, 2019

@posva the repro was wrong, I fixed it, the issue is a bit more complex.
It seems related to redirect

@frlinw

This comment has been minimized.

Copy link
Author

frlinw commented Apr 12, 2019

@posva may you give it an other try ?

@posva

This comment has been minimized.

Copy link
Member

posva commented Apr 12, 2019

Do the redirect in a child instead, that makes more sense 🙂

children: [
        {
          path: "home",
          name: "home",
          component: HomePage,
          children: [
            { path: '',  redirect: {
              name: "page-1"
            }},
            {
              path: "page-1",
              name: "page-1",
              component: Page1
            },
            {
              path: "page-2",
              name: "page-2",
              component: Page2
            }
          ]
        }
      ]
@frlinw

This comment has been minimized.

Copy link
Author

frlinw commented Apr 12, 2019

It means router-link-active works only in some cases since v3.0.3 and it's expected ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.