active-classrouter-link
is an attribute of the component of the vue-router module , and router-link
this style will be applied when the label is clicked.
router-link
Usingactive-class
attributes on tags alone-
<router-link to="/about" active-class="active">about</router-link>
Finally, style your selected links:
-
a.router-link-exact-active { color: plum; } .active { font-size: 16px; font-weight: bold; }
After clicking, no matter how you refresh the page, the style effect will not be removed unless you jump to other pages. . (which is not bad at all)