Last active
November 30, 2019 06:25
-
-
Save rslhdyt/ccf138cc895bf0418ffb4462f3557517 to your computer and use it in GitHub Desktop.
[watch nested data] vue js watch nested data #vuejs #javascript #vuewatch
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
<script> | |
export default { | |
data: () => ({ | |
form: { | |
id: 1 | |
text: 'ABC' | |
} | |
}), | |
watch:{ | |
'form.id': function (newVal, oldVal){ | |
//to work with changes in someOtherProp | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment