-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
v-link-active on parent containing multiple v-links is not working #583
Comments
Same issue with |
With this bug the class is only added when last child is selected. This is because each link either adds These are the key places in the code: https://github.com/vuejs/vue-router/blob/dev/src/directives/link.js#L40 |
@simplesmiler I'm not sure why sub routes would matter in the context of this bug? |
@tooblue with subroutes multiple DOM-nested links can be "active" at the same time (with inexact matching). Documentation is correct, but implementation is not. I will give it a whirl the next week, once I get back from vacation. |
It seems like the problem described by @tejitak here is possibly still an issue?
@simplesmiler Yes, but subroutes are not suitable for all applications. In my case, I simply want to visually style a group of arbitrary links which don't necessarily implement nested routes or components. This is a valid use case and seems to be something that adding
|
I always thought of |
+1? |
Vue.js & vue-router.js version
1.0.26, 0.7.13
Reproduction Link
http://jsfiddle.net/oenkitt/zzvbndza/
Steps to reproduce
Here is the basic structure of my navigation menu:
What is Expected?
The "v-link-active" class should be applied to the parent element when any of the child "v-links" match the current route.
What is actually happening?
The "v-link-active" class is only applied to the parent element when the last child element matches the current route.
In my example on jsFiddle, the "v-link-active" class should be applied to the "Leads" menu item if any of the contained sub-menu items ("Overview" or "Profiles") match the current route. Currently, this only works when the last sub-menu item ("Profiles") is active, but does not work when "Leads" or "Overview" are active.
The text was updated successfully, but these errors were encountered: