S
S
sldo_ru2020-07-01 20:40:11
Vue.js
sldo_ru, 2020-07-01 20:40:11

How to mark dynamic paths active in Vue?

Hello. There is a link that translates to the dynamic path /catalog/1. The problem is that it only stays active when I'm on /catalog/1. How to make it active on any /catalog/:id

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Michael, 2020-07-02
@Nolan81

There is a link to the dynamic path /catalog/1

is it a dynamic path?
What exactly do you need?

A
Alexander, 2020-07-02
@UPSA

Not really an answer, but maybe in this direction )))
Check
router-link-active - applied when the link is active
router-link-exact-active - applied when the link is active with an exact match to the path
https://router.vuejs.org/ru /api/#active-class
Or add a class to the links you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question