[Vuejs]-How add array of objects to data in vuejs?

0👍

You have a typo: should be this.$set(this.columnDef, 0, sth);. Not this.columnsDef – without s.

Also try to init you columnDef with [] in data:

data() {
  return {
    columnDefs: []
  }
},

Or set empty array right before assigning to zero index:

this.columnDef = []
this.$set(this.columnDef, 0, sth)

Leave a comment