[Vuejs]-Setting multiple variables on button @click

7๐Ÿ‘

โœ…

You can use one method

<v-btn @click.stop="setDeleteDialog(offer.id)"

methods: {
  setDeleteDialog (offerId) {
    this.dialogDelete = true
    this.deleteTemporaryId = offerId
  }
}
๐Ÿ‘คlatovic

12๐Ÿ‘

You can use arrow function for @click.stop:

@click.stop="()=>{dialogDelete = true; deleteTemporaryId = offer.id}"
๐Ÿ‘คdvnguyen

0๐Ÿ‘

This is a bit old and perhaps not previously possible, but for anyone landing here now, this can be achieved without an arrow function, i.e.:

@click.stop="dialogDelete = true; deleteTemporaryId = offer.id"
๐Ÿ‘คJaimerine

Leave a comment