vue remove the array (the object) of an item

delete and delete Vue.delete array of differences:

delete just removed element becomes empty / undefined key or change other elements.
Vue.delete delete an array of key changes in the array.

    var a=[1,2,3,4]
    var b=[1,2,3,4]
    delete a[1]
    console.log(a)
    this.$delete(b,1)
    console.log(b)

Published 94 original articles · won praise 29 · views 50000 +

Guess you like

Origin blog.csdn.net/weixin_41849462/article/details/87912654