I am looking to implement a confirm message using Vue.js that will only display if the data retrieved from an API contains a true value. The API output is shown below, and I have included the if condition used to trigger the alert message.
//API Data
{
"BNG-JAY-137-003": false,
"BNG-JAY-137-004": false,
"BNG-JAY-137-005": false
}
//Below is the if condition where the API output is stored in a variable 'selected_data'
if(this.selected_data){
if(confirm("Do you want to Turn On All lights")){
alert("Lights on")
}
}