[Vuejs]-Vue.js won't bind to an object property that's not pre-defined

1👍

For an object, you have to use Vue.set (or this.$set). See Reactivity In Depth from the docs.

-1👍

Vue js doesn’t allow you to access arrays directly. See the documentation at https://vuejs.org/2016/02/06/common-gotchas/

Instead of using

this.rowState[rowID] = newValue;

You should use

rowState.$set(rowID, newValue) 

or

rowState.splice(rowID, 1, newValue).

Leave a comment