How to use Vuetify tabs with vue-router
Date : March 29 2020, 07:55 AM
I wish this helpful for you Update Holy wow! I asked the Vuetify community to add documentation to their api, and it looks like they just added the to prop as well as other vue-router props to the Vuetify tabs docs. Seriously, the community there is awesome. <v-app dark>
<v-tabs fixed-tabs>
<v-tab to="/foo">Foo</v-tab>
<v-tab to="/bar">Bar</v-tab>
</v-tabs>
<router-view></router-view>
</v-app>
const Foo = {
template: '<div>Foo component!</div>'
};
const Bar = {
template: '<div>Bar component!</div>'
};
const routes = [
{ path: '/foo', component: Foo },
{ path: '/bar', component: Bar },
];
const router = new VueRouter({ routes });
new Vue({
el: '#app',
router,
});
|
Vertical vuetify tabs
Tag : vue.js , By : Robert Daniel Pickar
Date : March 29 2020, 07:55 AM
|
Vuetify Deselecting v-tabs
Tag : vue.js , By : alexandruz
Date : March 29 2020, 07:55 AM
I wish this helpful for you First tab is autoselected. A workaround : Add fake first tab with and a first empty tab item
|
v-tabs in vuetify is not taking 100% height
Date : March 29 2020, 07:55 AM
may help you . Context I'm posting an answer here since I found this question when searching to solve my own problem. In my case I wanted the tab content to occupy all the height. Which sounds similar to your problem, but since the question does not provide any specifics for the problem I will make some assumptions. new Vue({
el: '#app'
})
.tab-item-wrapper {
/* vuetify sets the v-tabs__container height to 48px */
height: calc(100vh - 48px)
}
<link href="https://cdn.jsdelivr.net/npm/vuetify@1.2.6/dist/vuetify.min.css" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@1.2.6/dist/vuetify.min.js"></script>
<div id="app">
<v-app>
<v-tabs>
<v-tab>tab</v-tab>
<v-tab-item>
<div class="tab-item-wrapper">
<v-layout align-center justify-center column fill-height/>
<v-btn color="success">Success</v-btn>
<v-btn color="error" outline>Error</v-btn>
</v-layout>
</div>
</v-tab-item>
</v-tabs>
</v-app>
</div>
|
Prevent Vuetify v-tabs from change
Date : September 29 2020, 01:00 PM
To fix the issue you can do You should have to follow this way in your code this is example which will help you: In ts file: <template>
<v-tabs v-model="activeTab">
<v-tab v-for="tab in tabs" :key="tab.id" :to="tab.route">{{ tab.name }}
</v-tab>
<v-tabs-items v-model="activeTab" @change="updateRouter($event)">
<v-tab-item v-for="tab in tabs" :key="tab.id" :to="tab.route">
<router-view />
</v-tab-item>
</v-tabs-items>
</v-tabs>
</template>
export default {
data: () => ({
activeTab: '',
tabs: [
{id: '1', name: 'Tab A', route: 'component-a'},
{id: '2', name: 'Tab B', route: 'component-b'}
]
}),
methods: {
updateRouter(val){
this.$router.push(val)
}
}
|