Put in order · Vue.js course · Module 2: Template Syntax

Conditional Rendering Steps

Order the steps of v-if from condition check to rendering:

Items to put in order

  • Vue checks the value of the v-if expression
  • The new Virtual DOM is compared with the previous one
  • The element is rendered in the browser
  • If true - the element is added to the Virtual DOM
Show the answer

Correct order:

  1. Vue checks the value of the v-if expression
  2. If true - the element is added to the Virtual DOM
  3. The new Virtual DOM is compared with the previous one
  4. The element is rendered in the browser