[Vuejs]-How to make selectable items

0👍

If its one state (e.x when you select you cannot toggle it back), then just remove the item parameter and convert the method like that

chooseBreakfast() {
  this.itemSelected = true
}

If you need to have a toggle state remove again the item parameter and convert the method like that

chooseBreakfast() {
  this.itemSelected = !this.itemSelected
}

Also remove from the @click handler the item param in both cases

Leave a comment