3
I have an object with the following format:
[
{
"id":1,
"name":"exemplo1",
"email":"exemplo1"
},
{
"id":2,
"name":"exemplo2",
"email":"exemplo2"
}
]
I need to delete an item from this object using ID intern of his.
Sort of like this:
delete item da lista onde item.id == id
I am using the Vue-2 framework to display in a table.
<tr v-for="{item, index} in list">
<div @click="delete(item.id)"></div>
</tr>
important: delete the item using index does not serve, I need it to be with the ID.
Where does this array? no
data
of component? inprops
? or comes from the server? And what is the action that makes this removal? is amethods
?– Sergio
@Sergio yes, this within a date and need to remove with methods
– John Covv
strange placement
importante: deletar o item usando o index não serve, eu preciso que seja com o ID.
– novic