[Vuejs]-Vue: Check which checkbox is checked and send along different data depending

0👍

The main problem with your code right now is your post object.

postData = {
  destination: this.checkedValue = 'Destination' ? this.destinationNumber : '',
  voicemail: this.checkedValue = 'Voicemail' ? true : ''
}

this.checkedValue = 'Destination' isn’t checking anything it is setting the value of checkedValue to Destination which will always evaluate to true. You need to change both of these to ==. Also, if you want to return false for Voicemail you need ?true:false not ?true:''. I’m not sure exactly what all your code is supposed to do, but this should get you on the right track.

Leave a comment