The v-show directive is a Vue.js directive used to toggle the display CSS property of a element with our data. If the data is true it will make it visible else it will make it invisible. First, we will create a div element with id as app and let’s apply the v-show directive to this element with data as a message. Now we will create this message by initializing a Vue instance with the data attribute containing either true or false.
Parameters: This directive accepts a single parameter which is the data.
Example 1: This example uses VueJS to show an element with v-show.
Example 2: This example uses VueJS to hide an element with v-show.
- Difference between VueJS and AngularJS
- What is the difference between created and mounted event in VueJS?
- Vue.js v-once Directive
- v-else-if Directive in Vue.js
- Vue.js | v-if directive
- Vue.js | v-else directive
- v-for Directive in Vue.js
- Vue.js | v-html directive
- AngularJS | Directive
- AngularJS | ng-value Directive
- AngularJS | ng-src Directive
- AngularJS | ng-jq Directive
- Vue.js | v-text directive
- AngularJS | ng-app Directive
- Vue.js v-cloak Directive
- v-bind Directive in Vue.js
- Vue.js v-on:click.alt Directive
- AngularJS | ng-if Directive
- AngularJS | ng-cut Directive
- Vue.js v-on:click.right Directive