Vue: vm.$watch on a specific property of objects in an array

Created on 14 Oct 2015  路  1Comment  路  Source: vuejs/vue

Feature request.
It will be useful and efficient to watch on a specified property of objects in an array. For example,
...
data: {
users: [{id:1, name:"peter", age:16},{id:2, name:"John", age:18}]
}
...
vm.$watch('users.name',function(newVal, oldVal){
// newVal and oldVal should return the particular user which name changed
},{deep:false}
);

>All comments

wtf. Document ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fergaldoyle picture fergaldoyle  路  3Comments

robertleeplummerjr picture robertleeplummerjr  路  3Comments

paulpflug picture paulpflug  路  3Comments

bfis picture bfis  路  3Comments

seemsindie picture seemsindie  路  3Comments