Vue · Junior · Question 24 of 75

Why shouldn't v-if and v-for be used on the same element?

Explanation

To show only some items, use a computed property like activeTodos. To hide the whole list, put v-if on a wrapper element or <template>.

Further reading

Problem with a question

Vue · Junior · question 24

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