How can you delete a property/key from a Vue.js data object (i.e. associative array) like this:
var vm = new Vue({
data: {
users: {
foo : { firstName: ..., lastName: ... },
bar : { firstName: ..., lastName: ... }
}
},
methods: {
someFunction : function ()
{
// how to remove `users.foo`?
}
}
});
Googling around, I found these two ways, but both don't work:
delete this.users.foo;is not updating the DOMthis.users.splice('foo', 1);is not working at all (probably only works on arrays, not on objects)