router-link with vue and vuetify confusion
I had the same problem, and I solved it like this:
<v-list-item v-else :key="item.text" link>
<!-- to -->
<v-list-item v-else :key="item.text" :to="item.link" link>
<v-list-item v-for="(child, i) in item.children" :key="i" link>
<!-- to -->
<v-list-item v-for="(child, i) in item.children" :key="i" :to="child.link" link>
JS
{ icon: "mdi-history", text: "Recientes", link: "/" },
Don't forget to put <router-view />
in the container.
<v-content>
<v-container class="fill-height" fluid>
<router-view />
</v-container>
</v-content>
v-list-tile
, v-btn
, and v-card
all extend router-link
, so you can use any of the router-link
attributes directly on those components instead.
In your case you can just use <v-list-tile :to="item.link">