I need your help with one simple thing. I dont see how to display content according the current tab.
I'm pretty sure the solution so close, something like v-if on content part.
<button v-for="tab in tabs"
v-bind:key="tab"
v-bind:class="['tab-button', { active: currentTab === tab }]"
v-on:click="currentTab = tab">
{{ tab }}
</button>
<div v-for="(fruit, fruit) in fruits" :key="fruit">
<p>{{ fruit.name }}</p>
<p >{{ fruit.price }}</p>
</div>
<div v-for="(vege, vege) in veges" :key="vege">
<p>{{ vege.name }}</p>
<p>{{ vege.price }}</p>
</div>
script part
currentTab: 'fruits',
tabs: ['fruits', 'veges'],
fruits: [
{
name: 'fruit', price: '3$'
}
],
veges: [
{
name: 'vege', price: '1$'
}
]