Question · Vue.js course · Module 2: Template Syntax

v-for with v-if - Best Practice

Which practice is recommended when you want to filter list elements?

Answer options

  • Use v-if and v-for on the same element
  • Use a computed property for filtering
  • Use JavaScript filter() in the template
  • Use v-show instead of v-if
Show the answer

Correct answer:

  • Use a computed property for filtering