vue in depth listening watch

The basic types of listeners are listening shallow
watch the depth of listening, listening complex types are deep listening (funciton, arrat, object)
//     listener Object 
Data () {
     return {
        a:{
            b:10,
            c:20
        }
    }
},
    watch:{
        a:{
            handler(a,b,c){
                console.log(a)
                console.log(b)
            },
                Deep: to true  // must add this attribute 
        }

 

Guess you like

Origin www.cnblogs.com/qdwds/p/11706954.html