I have v-for="pill in pills" loop that creates a set of panels, each of these panels includes a number that can be changed (either through +/- buttons or by directly editing them). All of the panels are in an Array of Objects (one of the properties of these Objects is that amount)
I would like to react when the amount changes in one of the panels (and make an HTTP call). Today I do that by watching the whole Array:
watch(() => pills.value, () => console.log('a pill changed'), { deep: true })
This is not practical, though, because I have to send all the objects one by one through the HTTP call above because I do not know which of them changed.
It would be great if I could somehow watch() each of the pill separately, and act upon changes on specific ones (i.e. send only the one that changed). Is this possible?
eg 1
eg 2