Vue-router: Multiple router-link-active when route match pattern

Created on 27 Dec 2016  路  2Comments  路  Source: vuejs/vue-router

Hello everyone ! I am currently facing a strange issue using Vue js 2.0 and router (2.1.1)
Given the route "/user/:id", whenever I have /user/1 or /user/1* (it will append router-link-active class)
Ex: /user/11, /user/111, /user/1111 etc. all router-links that have this path will be set as active, causing multiple links to have the active class.
I guess it is a bug with Vue router itself, any ideas ?

Best,

Most helpful comment

Maybe exact prop can help you out.

See: http://router.vuejs.org/en/api/router-link.html

All 2 comments

Hi!
Please make sure to follow the Issue Reporting Guidelines before opening an issue.
Thanks!

Maybe exact prop can help you out.

See: http://router.vuejs.org/en/api/router-link.html

Was this page helpful?
0 / 5 - 0 ratings