VueJS Router - How do I stop multiple active routes when using sub routes and Vuetify?
You have to add exact
(or exact={true}
) prop to <v-list-item>
component:
<v-list-item
v-for="item in items"
:key="item.title"
:to="item.route"
exact
></v-list-item>
On v-list-item
docs for exact
:
Exactly match the link. Without this, '/' will match every route. You can find more information about the exact prop on the vue-router documentation.
You can check that out:
https://vuetifyjs.com/en/components/list-item-groups#list-item-groups