[Vuejs]-Vue Axios Push Array isn't updated live

0👍

The changes to rows are detected by Vue, if you add {{ rows }} in the template you’d see that.

But changes made the rows don’t automatically result in change of the urlpdf value.

You can add a watch on rows to run the code that updates pdfurl, but in this case I would just call the Report() method after the response is processed and the rows contain the results, like so:

.then(response => {
  this.rows = []
  for (let i = 0;i < response.data.length;i++) {
    this.rows.push({profile_id: response.data[i].profile_id,profile_name: response.data[i].profile_name,profile_actived: response.data[i].profile_actived})
  }
  this.Report('preview') // <- here
})

Leave a comment