InterviewSolution
Saved Bookmarks
| 1. |
What is the v-show directive? Show with a simple example code. |
Answer»
An element with a v-show which is ‘h1’ will always be rendered and remain in the DOM; v-show only toggles the display CSS property of the element. Example for V-show <div id="app"> <div v-show="showText"> <p>Show the first nice text</p> </div> <div v-show="!showText"> <p>Show the second bad text</p> </div> <button v-on:CLICK="showText = !showText">Toggle texts</button> </div> NEW Vue({ el: "#app", data: { showText: TRUE, } })Result:
|
|