Created
October 7, 2019 21:30
-
-
Save RuslanHolovko/69f6f913b53194f18c3f64a7dd56b719 to your computer and use it in GitHub Desktop.
watch object properties (Vue)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//data | |
data(){ | |
return{ | |
user:{ | |
name: 'Andrew', | |
age: '20' | |
} | |
} | |
} | |
// hook | |
watch:{ | |
user:{ | |
handler(val){ | |
console.log('watch elem'); | |
console.log(val); | |
}, | |
deep: true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment