Views: 2647
Last Modified: 27.04.2022
Using the parameter watch
to observe the array triggers the callback only when fully replacing the array. If for your callback is required to trigger upon an update as well - indicate the parameter deep
:
watch: {
listElements: {
handler(currentValue, previousValue)
{
console.log('array is changed');
},
deep: true,
},
}
You can find more details in the migration guide.