I am struggling with using the v-model
directive to manage data in an input field. My goal is to monitor changes to this data, but when I try to watch it, the old and new values always appear identical. This behavior is a result of the data being mutated, as explained in the documentation: https://v2.vuejs.org/v2/api/#vm-watch
It's important to note that when mutating an Object or Array instead of replacing it entirely, the old and new values will be the same because they are referencing the same Object/Array. Vue does not store a separate copy of the value before mutation.
My question is, how can I use v-model
without causing the data to be mutated?