VUEJS remove Element From Lists?

后端 未结 5 2018
渐次进展
渐次进展 2021-01-31 02:36

it is possible to remove specific element from lists. i tried this functions for remove element

pop() = remove last element

$remove(index) = n

5条回答
  •  情话喂你
    2021-01-31 03:20

    The $.remove feature has been replaced with $.delete.

    You can call it like so:

    this.$delete(this.someItems, itemIndex).

    It works on Object as well as Array. With objects, you need to use a keyed object. With arrays, you pass in the index of the item you want to delete.

    Here is a fiddle example: https://jsfiddle.net/james2doyle/386w72nn/

    EDIT

    I added an example for an array as well

提交回复
热议问题