vuejs delay watch 1

vuejs delay watch

this.data = data

this.$watch('data',  () => {
    alert('watch');
})

Here is what the above code is Doing:
1. We’re creating a new Vue instance.
2. We’re setting the data property to an object with a property called data.
3. We’re using the $watch method to watch the data property.
4. We’re setting the callback function to alert the user when the data property changes.

Now, let’s see what happens when we change the data property:

Similar Posts