I have following code
<div class="tabs-container-block">
<div v-for="n in tabs.length" :class="n-1 === showTab ? 'tab-title active-title' : 'tab-title'"> {{ tabs[n-1].TabTitle }}</div>
</div>
`,
data() {
return {
showTab: {
type: Number,
default: 0
}
}
},
Im trying to use the 'n' value from v-for and ternary operator to switch style classes.
Currently it is not working, how can I achieve that ?