Vue · Junior · Question 17 of 75
Why might the DOM not be updated immediately after changing state?
- ✓Correct answer: Vue batches updates and applies them asynchronously in the next tick; use
await nextTick()to wait - 2Vue updates the DOM only once per second
- 3The DOM is updated only when the user clicks somewhere
Explanation
Changing state several times in a row results in a single DOM update. If you need to measure the updated DOM, call await nextTick() after the change.