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

Conditional Rendering Process

Order the steps of v-if in Vue:

Items to put in order

  • Vue checks the condition value
  • Condition false: the element is removed from the DOM
  • Condition true: the element is rendered in the DOM
  • Condition change: Vue re-evaluates and updates the DOM
Show the answer

Correct order:

  1. Vue checks the condition value
  2. Condition true: the element is rendered in the DOM
  3. Condition false: the element is removed from the DOM
  4. Condition change: Vue re-evaluates and updates the DOM