vue中watch深度监听
时间:2019-10-20 12:35:21
收藏:0
阅读:678
监听基本类型的都是浅度监听
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 // 必须加这个属性 }
原文:https://www.cnblogs.com/qdwds/p/11706954.html
评论(0)