[Vuejs]-How to modify items based on selected items on vuetify data table

2๐Ÿ‘

โœ…

  • Looping through desserts
  • spread each item with a new isActive property
  • assign Boolean return value from the .includes method to isActive
sendData() {

    let result = this.desserts.map((item) => ({ ...item, isActive: this.selected.includes(item) }));
    console.log(result);

}

Code Pen Demo

Leave a comment