visma-meglerfront / sweet-modal-vue

The sweetest library to happen to modals.
Other
757 stars 85 forks source link

tabs not working with v-for #83

Open NaturalDevCR opened 5 years ago

NaturalDevCR commented 5 years ago

<sweet-modal-tab v-for="types in mealTypes" :key="types.id" :title='types.name' :id="'types.id'">

this is not showing tabs as expected with a for loop, if i remove the for-loop then it works, any idea what could be happening?

PewQuadrat commented 5 years ago

<sweet-modal-tab v-for="(t,i) in test" :key="i" :title="t.name" :id="t.id">{{t.name}}</sweet-modal-tab>

It's working. The Data-Set as following:

test: [ { name: "One", id: "1" }, { name: "Two", id: "2" }, { name: "Three", id: "3" } ],

Or as an alternative use the index of the v-for as id and convert to string

<sweet-modal-tab v-for="(t,i) in test" :key="i" :title="t.name" :id="i.toString()">{{t.name}}</sweet-modal-tab>