Answers for "nuxt link active vs nuxt link exact active"

0

nuxt link active vs nuxt link exact active

<nav>
    <nuxt-link to="/">Home</nuxt-link>
    <nuxt-link to="/explore">Explore</nuxt-link>
    <nuxt-link to="/about">About</nuxt-link>
</nav>

.nuxt-link-active {
    font-weight: bold;
}

If user navigates to /explore or /about route, the styling will get applied to / route as well which in practice is not desired.

Well, to resolve this issue one is prompted to use nuxt-link-exact-active along similar lines.


.nuxt-link-exact-active {
    font-weight: bold;
}
Posted by: Guest on February-02-2022

Browse Popular Code Answers by Language