So, I have a navigation bar with router-links. What I want is for the selected link to remain highlighted on selection, so that the users know which page they are on. Currently I have something like this.
<div class="mynav">
<router-link to="...">...</router-link>
....
</div>
...
.mynav {
...
}
.mynav a {
...
}
.mynav a:hover {
...
}
I tried to use .mynav a:active, but that didn't work.
Just add this style to the style tag inside the Vue component:
<style lang="css">
.router-link-exact-active {
border-bottom: 1px solid #123456;
}
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With