K
K
kroha30002020-05-22 18:21:01
Vue.js
kroha3000, 2020-05-22 18:21:01

How to highlight the active menu item?

how to highlight a menu item depending on the page we are on? That is, select the active item. Apply a style class to it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-05-22
@kroha3000

You won't believe it, but it's in the documentation
https://router.vuejs.org/en/guide/#javascript
Please note that it automatically gets the .router-link-active class when the route matches. You can learn more about this in the API reference.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question