VueJS Conditional show and hide Directives Example

Today, We want to share with you VueJS Conditional show and hide Directives Example.
In this post we will show you VueJS show and hide directive Example | Conditional Directives With Vue.js, hear for (v-if, v-else-if, and v-else directives) we will give you demo and example for implement.
In this post, we will learn about Conditional Directives With Vue.js with an example.

Uses of v-show in vuejs

Toggle’s the HTML element’s all display CSS property based on the truthy-ness data of the simple expression value print.This v-show directive to the triggers transitions when It is a v-show and hide condition changes.

READ :  Vuejs deep nested computed properties

Note : that v-show directive does not support the

<mark><h1 v-show="labelbl">Welcome to vuejs dev.!!</h1></mark>

The Conditional display (using v-show) in vuejs.

vue.js – hide and show elements – Example

<body>
  <div id="ng4app">
	<ul v-bind:class="{'is-collapsed' : collapsed }">
	<li>vuejs v-show example.</li>
	<li>vue js v-show example.</li>
	<li>vue js hide element.</li>
	<li>vuejs v-if example.</li>
	<li>vuejs v-cloak.</li>
	<li>vue.js conditional class.</li>
	<li>vue v-show example.</li>
	<li>v-show not working.</li>
	</ul>
	<button v-on:click=" collapsed = !collapsed">More...</button>
</div>
</body>

Script Code

var app = new Vue({
	
	el: "#ng4app",
	data: {
		collapsed: true
	}
});

Conditional elements with v-if and v-show

<div id="vue-instance">
  <div v-show="logindata">
    Welcome to infinityknow.com!
    <button @click="addlogin" type="submit">SignOut</button>
  </div>
  <div v-else>
    <input type="text" placeholder="Your Good Name">
    <input type="password" placeholder="Please 8 letters password">
    <button @click="addlogin" type="submit">Sign In</button>
  </div>
</div>

v-cloak instead of hide

<div v-cloak>
<p>Learn the basics of VueJs with practical examples </p>
 <h2>{{ message }}</h2>
</div>

We hope you get an idea about VueJS Conditional show and hide Directives Example
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

READ :  AngularJS Modal Popup open and close from controller

We hope This Post can help you…….Good Luck!.