Vue · Junior · Question 40 of 75

Where should you access the DOM after the component is rendered?

Explanation

<script setup> runs before the component is mounted, so the DOM doesn't exist yet. onMounted runs after the first render; it is also never called during SSR.

Further reading

Problem with a question

Vue · Junior · question 40

Test yourself

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

Take this quiz