Vue TutorialLesson 6Free preview
Vue v-show
This lesson is part of Vue · All levels
Summary
The v-show directive works by manipulating the CSS display property on the element: the element remains in the DOM, only hidden from view when its false condition. This approach makes the display transfer very inexpensive, making it suitable for elements that are often opened and closed. However, v-show does not support v-else branches and cannot be used on template elements.
Key points
- V-show hides elements by changing the CSS display.
- The elements remain rendered in the DOM despite their hidden appearance.
- The v-show is suitable for frequently changing elements.
- V-show does not support v-else or v-else-if.
- V-show does not work on template elements that do not render DOM elements.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.