Vue Watchers

Watchers allow you to run code in response to changes in data.

Snippet:

watch: { message(newValue, oldValue) { console.log(`Message changed from ${oldValue} to ${newValue}`); } }

Example:

data() { return { message: "Hello" }; }