Vue-router: home link always stays active

Created on 12 Oct 2016  ·  2Comments  ·  Source: vuejs/vue-router

I was using **router-link-active** class to highlight the active link in menu but even when other links are clicked, the home link with newly clicked menu link ,both, show active state. So i just hurried to official example and updated the path: '/foo' to path: '/' and noticed the same problem. Active state works fine with other route paths i.e. '/home', '/foo', '/user' but always remains active for path: '/' even when it is inactive

bug

Most helpful comment

All 2 comments

this fix it

<!-- this link will only be active at / -->
<router-link to="/" exact>
Was this page helpful?
0 / 5 - 0 ratings