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 element needs to be matched only with url sensitive not query #2319

Closed
HKskn opened this issue Jul 27, 2018 · 1 comment
Closed

Comments

@HKskn
Copy link

HKskn commented Jul 27, 2018

What problem does this feature solve?

I'm not sure is it bug or deliberately made. My problem is when I give an option to router-link as to="{path: '/audit', query: {year}}" and if application routed to '/audit/blabla' then router-link element loses active class because of the query. If there is a different option to mark an element as active by specified match type, we could easily manage the active link elements. Options may be 'url' or 'url query' even may be an array of strings. In this way we can handle much combinations.

What does the proposed API look like?

// should match only path and query
<router-link :to={path: 'blabla', query: {'blalba': 'xxx'}} :match-type="['url', 'query']"> </router-link>

// should match only with url, It same as exact
<router-link :to={path: 'blabla', query: {'blalba': 'xxx'}} :match-type="['url']"> </router-link>
@posva
Copy link
Member

posva commented Aug 2, 2018

Duplicate of #2040

@posva posva marked this as a duplicate of #2040 Aug 2, 2018
@posva posva closed this as completed Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants