Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$vm.$delete('object.key') doesn't work #3368

franciscolourenco opened this issue Aug 1, 2016 · 3 comments

$vm.$delete('object.key') doesn't work #3368

franciscolourenco opened this issue Aug 1, 2016 · 3 comments


Copy link

franciscolourenco commented Aug 1, 2016

Vue.js version


Reproduction Link,js,console,output

Steps to reproduce


What is Expected?

$vm.object.key should not exist
$vm.$set('object.key', value) seems to work fine

What is actually happening?

$vm.object.key doesn't change

Copy link

itsMapleLeaf commented Aug 1, 2016

$set and $delete are deprecated in the new version. Use Vue.set and Vue.delete instead.

toggleRow: function(row) {
  key =
  if (this.selectedRows[key]) {
    console.log('deleteRow: ', key)
    Vue.delete(this.selectedRows, key)
  else {
    Vue.set(this.selectedRows, key, row)

Copy link

yyx990803 commented Aug 1, 2016

Note the API only supports deleting the vm's own keys. Also, prefer Vue.delete.

Copy link

luckylooke commented Apr 17, 2020

@kingdaro vm.$set and $vm.delete does not seem to be deprecated in actual version 2.x :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

4 participants