Tag : javascript

VueJs Series with Nirmal : Difference between v-if and v-show

Welcome to the VueJs series with Nirmal.

v-if

The control structure followed by VueJs for the UI element rendering. v-if supports the control branching if..else if..else.

A quick example to render spans based on the value typed in the input.

It renders the “Fruits” and “Birds” span when typed “Fruits” and “Birds” in the input text respectively. Otherwise it renders “Animal” span.

v-show

A boolean control to manage display of an UI element.

As the “show_sky” variable used in this example, depending on that it either displays the span or hides it.

v-if vs v-show

  • Unlike v-if, v-show has no else part
  • v-if only renders the elements which satisfies the condition. But v-show, renders all elements and manages with css “display” attribute.

Video

The video contains the demonstration of v-if vs v-show

Hope this helps.

Categories: VueJs

Vue.JS – An introduction

What is Vue.Js

A progressive javascript framework for building the UI. It is built on top of Javascript. Mainly focuses on the View layer for interactive UI designs.

Any pre-requisite knowledge to learn it ?

HTML, CSS and Javascript should be the basic one to know to start with it.

A quick introduction to kick start

Hope this helps.

Please do comment.

Categories: VueJs

%d bloggers like this: