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

Navigating with anchor tag makes exact router-links lost its class #2123

Closed
shirohana opened this issue Mar 23, 2018 · 2 comments
Closed

Navigating with anchor tag makes exact router-links lost its class #2123

shirohana opened this issue Mar 23, 2018 · 2 comments

Comments

@shirohana
Copy link

Version

3.0.1

Reproduction link

https://codesandbox.io/s/1340kjpvvl?autoresize=1&initialpath=%2Fa%2F1&module=%2Fsrc%2Fcomponents%2Fview.vue

Steps to reproduce

(From demo page)

  1. Click Anchor tags link, it will append #anchor to the href of current page
  2. Click refresh link, just like sharing a link with a specific paragraph

What is expected?

The link should still has its active class (but only when mode: 'history')

What is actually happening?

vue-router also compared its hash, so it's no longer exact and lost its class


I think if we're in history mode, it is no need to compare route.hash

https://github.com/vuejs/vue-router/blob/dev/src/util/route.js#L73-L94

@posva
Copy link
Member

posva commented Mar 23, 2018

Let's move the discussion to #2040 (which was originally for queries) but it is the same kind of problem: exact is not flexible enough

@posva posva closed this as completed Mar 23, 2018
@shirohana
Copy link
Author

I see, thanks :)

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