-
-
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 only works on direct parent #377
Comments
Same here. It would be useful to keep a class on parent's parents. When you have nested routes the elements which link to parent route should have a supplementary class (v-link-active-trail) for instance. Would be useful... |
More over, it would be interesting, in certain case, to work on multiple |
It would probably have performance issues then, because it needs to go all the way up to find |
In my opinion I would say it's quite fast since it knows where to go (any dom element has only one parent up to I made a quick & easy fix, simply put : Works like a charm. Here's the code : hasRoute: function (partial) {
return (this.$route.path.indexOf(partial) > -1)
} This let me place the active class anywhere I want. |
Cannot reproduce this, can you provide a jsfiddle? |
Hmm let me guess - are you having something like this? <li v-link-active>
<ul>
<li v-for="xxx" v-link="xxx">xxx</li>
</ul>
</li> |
@yyx990803 I guess so. Here is a working example. Currently each link directive listens How about making either of the following changes?
|
Fixed in 3d12e95 (multiple |
I'm trying to use the new v-link-active attribute and it only seems to work on the direct parent. I'd need to use it nested in a
<li v-link-active><ul><li><a v-link="...">
scenario.The documentation hints that this should work: "v-link will locate the closest parent element that has v-link-active and apply the active classes on that element instead."
Also, I have a use-case where multiple
v-link-active
would prove useful, e.g.<li v-link-active><ul><li v-link-active><a v-link="...">
. Would be awesome if that would work as well.The text was updated successfully, but these errors were encountered: