In this chapter we are going through some basic examples of Vue's directives. Well, if you have not used any framework like Vue.js or AngularJS before, you probably don't know what a directive is. Essentially, a directive is some special token in the markup that tells the library to do something to a DOM element. In Vue.js, the concept of directive is drastically simpler than that in Angular. Some of the directives are:
v-showwhich is used to conditionally display an element
v-ifwhich can be used instead of
v-elsewhich displays an element when
v-showevaluates to false
Also, there is
v-for, which requires a special syntax and its use is for rendering (for example, render a list of items based on ...