[Vuejs]-Deleting from list in vue.js

0👍

try to pass joke object into function, and find index

delJoke(joke) {
  var index = this.setList.indexOf(joke)
  ... your code
}

0👍

your delete button must be inside the v-for.

and the delete function should look like this

delJoke(index) {
    this.viewJoke = this.viewJoke.splice(index,1);
}

Leave a comment