1
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 mine listaProjetosModelos
have 100 items, and when I click on Editar
to edit a specific item, it opens all 100 modals, rather than just that specific item in my table.
What I don’t understand is why this is happening.
Some solution to this?
Example running: https://jsfiddle.net/au12Ley0/
Guy can make an executable example for us to try to help?
– LeAndrade
I’ll only do one minute
– Julio Rodrigues
Ready @Leandrade https://jsfiddle.net/au12Ley0/
– Julio Rodrigues
Analyzing here, I could notice that what impacts is the modalOpen === true. This makes it open all. But how to make only one specific...
– Julio Rodrigues