E
E
Eugene2021-09-13 02:02:13
Vue.js
Eugene, 2021-09-13 02:02:13

Why doesn't VueRouter 4 define linkActiveClass on the route?

A small project is migrating from Vue 2.x to 3.x.
I'm seeing a small problem (or I'm missing something and can't find it) a new parameter or setting in VueRouter 4.x

For some reason, the class "linkActiveClass" is not marked on internal routes (inexact occurrence). Moreover, if you change the global settings themselves (the name of the classes, for example), they work out, but the links themselves are marked only with the router-link-exact-active class.

update:

  • here is a working example on Vue2 codesandbox.io
  • here is exactly the same example on Vue3 codesandbox.io , but it doesn't work anymore

I explain: that links that do not have an exact occurrence are not marked with a class.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question