Vue · Middle · Question 10 of 75

When does a watcher with flush: 'post' run?

Explanation

By default watcher callbacks run before the component's DOM update. flush: 'post' (or watchPostEffect) is for reading layout; flush: 'sync' runs immediately on every change and should be rare.

Further reading

Problem with a question

Vue · Middle · question 10

Test yourself

Take the Vue · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz