我需要獲取數組內部的對象屬性更改。 爲了做到這一點,我使用了vue。$ watch。 我閱讀文檔,但我沒有得到。
的情況是:
...
data() {
return {
Questions: [{foo: 1}, {foo: 2}, {foo: 3}]
}
},
...
this.$watch("Questions", function (newVal, oldVal) {
// something...
}, { deep: true });
更新過的
的解決方案就在這裏!
我不知道要明白什麼是不是與你的jsfiddle –