Vue.js - updated array item value doesn't update in page
This is due to the array change caveats.
Do it like this instead
var vue = new Vue({
el: '#content',
data: {
test: [{
array: [0, 0, 0, 0]
}, {
array: [0, 0, 0, 0]
}],
number: 0
},
methods: {
setNumber: function() {
this.number = 5;
console.log(this.number);
},
setArray: function() {
//this.test[0].array[0] = 9;
this.$set(this.test[0].array, 0, 9);
console.log(this.test[0].array[0]);
}
}
});
Here is thefiddle