Answer the question
In order to leave comments, you need to log in
How to properly set up v-tabs in vuetify.js?
Good afternoon. I use this component https://vuetifyjs.com/ru/components/tabs and I can't understand its structure. How to display information in the desired tab, otherwise in the example it displays immediately in all tabs? I can't figure out how it's set up. So how to nest a component, let's say card.vue in the desired tab?
Answer the question
In order to leave comments, you need to log in
Is there an example there?
<v-tabs v-model="active">
<v-tab v-for="n in 3" :key="n">Item {{ n }}</v-tab>
<v-tab-item v-for="n in 3" :key="n">
Любое содержимое
</v-tab-item>
</v-tabs>
data: function(){
return {
tabList: [
{caption: 'Вкладка 1', content: '<h1>Содержимое первой вкладки</h1>'},
{caption: 'Вкладка 2', content: '<h1>Содержимое второй вкладки</h1>'},
{caption: 'Вкладка 3', content: '<h1>Содержимое третьей вкладки</h1>'},
]
}
}
<v-tab v-for="(tab, index) in tabList" :key="index">Item {{ tab.caption }}</v-tab>
<v-tab-item v-for="(tab, index) in tabList" :key="index">
<div v-html="tab.content"></div>
</v-tab-item>
<v-tab :key="1">Tab 1</v-tab>
<v-tab :key="2">Tab 2</v-tab>
<v-tab-item :key="1">Содержимое вкладки 1</v-tab-item>
<v-tab-item :key="2">Содержимое вкладки 2</v-tab-item>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question