vueでwatchを使用してオブジェクトのプロパティを監視する方法

442 ワード

単層モニタリングはこの変数を直接書く方法であるが、深さモニタリングwatch:{ 
// : vue  
age:(newValue,oldValue) => { 
console.log('name newValue :'+newValue+', :'+oldValue); 
}, 
user:{ 
handler:(newValue,oldValue) => { 
console.log('age newValue :'+newValue.age+', :'+oldValue.age); 
// ,  
}, 
deep: true // ,