我需要获取数组内部的对象属性更改。 为了做到这一点,我使用了vue。$ watch。 我阅读文档,但我没有得到。
的情况是:
...
data() {
return {
Questions: [{foo: 1}, {foo: 2}, {foo: 3}]
}
},
...
this.$watch("Questions", function (newVal, oldVal) {
// something...
}, { deep: true });
更新过的
的解决方案就在这里!
我不知道要明白什么是不是与你的jsfiddle –