I have the following jsfiddle that has two Vuetify tabs. The documentation doesn't show examples on using vue-router
with them.
I found this Medium.com post on how to use Vuetify with vue-router
, which has the following code:
<div id="app">
<v-tabs grow light>
<v-tabs-bar>
<v-tabs-item href="/" router>
<v-icon>motorcycle</v-icon>
</v-tabs-item>
<v-tabs-item href="/dog" router>
<v-icon>pets</v-icon>
</v-tabs-item>
</v-tabs-bar>
</v-tabs>
<router-view />
</div>
However, the code is now outdated as the Vuetify 1.0.13 Tabs documentation doesn't specify a router
prop in their api, so the embedded example in the post doesn't work.
I also found this StackOverflow answer which had the following code:
<v-tabs-item :to="{path:'/path/to/somewhere'}">
However, using the to
prop doesn't work and it's also not listed in the Vuetify api. In contrast, the v-button
Vuetify component does list a to
prop and utilizes vue-router
, so I would expect a vue-router
supported component to support the to
prop.
Digging around in the old old Vuetify 0.17 docs, the to
prop is specified for v-tabs-item
. It seems that support might have been removed in 1.0.13.
How can I use vue-router
with Vuetify tabs?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…