[Vuejs]-Update v-for When Data Is Added To Array – VueJS

2👍

You can use concat which returns a new concatenated array:

axios.post('http://localhost/get_array.php')
  .then(response => {
    this.existingArray = this.existingArray.concat(response.data)
  })
  .catch(e => {
    console.log("Error")
  })

Updating existingArray with the result of calling concat with the response data should trigger the update.

Leave a comment