监听基本类型的都是浅度监听
watch的深度监听,监听复杂类型都是深度监听(funciton ,arrat ,object)
// 监听对象 data(){ return { a:{ b:10, c:20 } } }, watch:{ a:{ handler(a,b,c){ console.log(a) console.log(b) }, deep:true // 必须加这个属性 }
// 监听对象 data(){ return { a:{ b:10, c:20 } } }, watch:{ a:{ handler(a,b,c){ console.log(a) console.log(b) }, deep:true // 必须加这个属性 }