[Vuejs]-How to fix binding issue in Vue js

0👍

As mentioned in the comments, it’s a reactivity issue. Only setting the whole value, using certain array methods, or using the .$set method will trigger the reactivity. You need to do something more like

const days = this.daysMatrix
days[indexProject][0].hours = 0
days[indexProject][1].hours = 0
//...

this.daysMatrix = days

or

this.daysMatrix[indexProject].forEach((value, index) => {
  this.$set(this.daysMatrix[indexProject][index], 'hours', 0)
})

Leave a comment