Vue · Middle · Question 54 of 75
How do you watch several sources with one callback?
watch([page, () => filters.status], ([newPage, newStatus]) => {
load(newPage, newStatus)
})- ✓Correct answer: Pass an array of sources; the callback receives arrays of new and old values
- 2Call
watchwith a comma-separated string - 3One watcher can only observe one source
Explanation
Sources can be refs, reactive objects or getter functions. A property of a reactive object must be wrapped in a getter.