-
-
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
Tag prop on <router-link> doesn't work since 2.0.0-rc.6 #707
Comments
Thanks! It's indeed a bug. |
Fix click event not bound for `<router-link>` when tag is not `<a>` and doesn't have child `<a>`
I'm not sure it qualifies as a bug, but it's definitely worth an enhancement. The point is that one should use the tag attribute to define the element that will receive the "active" class, and define the actual If my understanding is correct, there's three things to do:
|
@LinusBorg It's not about active classes, it's the element itself didn't get click events bound on it. It used to work in all previous versions. |
I think Evan added it specifically for the purpose I explained: Also see the explanation in the migration guide about It is just missing fallback handling in case no link is provided in the slot. |
Well then I guess we need to ask @yyx990803 to explain all this.. |
http://vuejs.org/guide/migration-vue-router.html#v-link-active-deprecated This described behaviour should simply be extended to include button elements also, and fall back to the root element of neither are found. |
Will this be fixed then ? Wondering if I should go ahead and re-do all my navigation |
There's already a PR in review. Just out of curiosity: So all your navigation does work without any |
Vue Router would attach the event to the li tag , since im in a SPA it doesn't require the use of the a tag . |
I would rather consider it good form to use the appropriate tags for navigation elements. For Screenreaders, or so the URL shows up at the bottom of the window when you hover the link etc. Nontheless, the described fallback should be implemented, the review is still inprocess though. |
I agree , have already switched it up On Monday, October 10, 2016, Thorsten Lünborg notifications@github.com
|
@LinusBorg My understanding is that ARIA provides That said, I didn't realise until researching this reply that HTML5 changed the definition of the |
Tjhe breaking change was unintended and will be fixed with the mentioned PR. |
Versions
vue.js : 2.x
vue-router: > 2.0.0-rc.5
Reproduction Link
https://jsfiddle.net/9b80nxx1/6/
Update (link above is broken) : http://jsfiddle.net/VincentGarreau/4L240m47/1/
Steps to reproduce
Click on "Other"
What is actually happening?
The route is not updated with vue-router >= 2.0.0-rc.6, but it's working with <= 2.0.0-rc.5.
The text was updated successfully, but these errors were encountered: