I have set up very basic routing on a Vue project using vue-router
.
The router-link-active
classname gets applied as expected to the active root. In the following gif, that would be 'Foo' when /foo
is active, etc.
However, the link to 'Hello world' also has the router-link-active
classname.
Why does it get applied and how can I ensure it's only active when I am on /
(localhost:8080
)?
Put
exact
prop to your"/"
routeHere is what you need: jsFiddle