I cannot make the active button (router-link tag) to light up.
Here is my code:
<div class="bottom-buttons">
<span v-for="button in buttons" class="button" :class="{ 'is-active': $route.path === button.path}">
<router-link :to="button.path">
<i :class="button.iclass"></i>
<p class="button-label">{{button.label}} </p>
</router-link>
</span>
</div>
When I print out $route.path
it returns the right path, and button.path
is the data I have in the data object, and it works. So the condition should be right. But the 'is-active'
class is not activated. (This thread: VueJS exact-active-class)
If I hard-code the 'is-active'
class, it works.
When I use a:hover, a:visited, a:link
it works, but a:active
does not work :D. I have tried a:router-link-active
but it does not work. (This thread: How to VueJS router-link active style)
I have tried to add linkActiveClass: 'is-active'
in the /router/index.js
file as suggested. It does not work. (This thread: Bulma navbar and VueJS router active link)
Anybody knows why? Or have more suggestions? Thank you in advance!