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

Active class for links with query params #209

Closed
Rhincodon opened this issue Oct 29, 2015 · 4 comments
Closed

Active class for links with query params #209

Rhincodon opened this issue Oct 29, 2015 · 4 comments
Labels

Comments

@Rhincodon
Copy link

HI. I have v-link to named route without query params. Active class works correctly on exact matching and within subroutes. But if I go to the same route with query params, active class no longer works.

Example:
I have link to users list in sidebar — /users. Active class works when route match /users and on subroutes like /users/1. But it does not work within route like /users?page=2.

On version 0.6.1 that behavior worked correctly, but on 0.7.5 it no longer works.

@Rhincodon
Copy link
Author

Now active class for routes like /users?page=2 working. But active class for links to inner routes like /users/1 or /users/1?page=1 no longer works if we have params AND query in named v-link. If we have just params it works. In previous 0.7.5 both params and query works together well, and active class toggled as needed.

@Rhincodon
Copy link
Author

Still not working previous comment. I created fiddle to illustrate what I mean https://jsfiddle.net/co5mmz46/. When we on bar route, bar link is not active. If we remove query on line 5 it will work. But if we have both params and query in v-link, active class not working.

@pajter
Copy link

pajter commented Jan 14, 2016

This is still not working for me. I'm seeing in my debug console that the regex is testing for '^url' while path contains '/url'. So that regex because of the leading slash...

@yyx990803
Copy link
Member

@pajter please open a separate issue with a reproduction using the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants