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

Difference: v-if vs v-show

What is the difference between v-if and v-show?

Answer options

  • v-if removes the element from the DOM, v-show toggles display: none
  • There is no difference
  • v-show is slower
  • v-if only works with booleans
Show the answer

Correct answer:

  • v-if removes the element from the DOM, v-show toggles display: none