I have the following code snippet:
<template v-for="(item, index) in listaProjetosModelos">
<tr :key="index">
<td class="text-center">
{{item.nome_projeto}}
</td>
<td class="text-center">
{{item.departamento}}
</td>
<td class="text-center">
{{item.total_tarefas}}
</td>
<td class="text-center text-nowrap">
<span class="mr-2" @click="show()">Editar</span>
<span class="mr-2" @click="show()">Excluir</span>
<span @click="show()">Detalhes</span>
<!--- MODAL FORM Editar ProjetoModelo -->
<template>
<modal name="hello-world">
<div class="col-md-12">
<h2>Editar</h2>
</div>
</modal>
</template>
</td>
</tr>
</template>
And the method:
show() {
this.$modal.show('hello-world', {
title: 'Editar Projeto Modelo'
});
},
What happens is that if in my listaProjetosModelos
you have 100 items, and when I click on Editar
to edit a specific item, it opens all 100 modals, instead of just that particular item in my table .
What I do not understand is why this is happening.
Any solution for this?
Running example: link