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:
- Vue checks the value of the v-if expression
- If true - the element is added to the Virtual DOM
- The new Virtual DOM is compared with the previous one
- The element is rendered in the browser