Conditional Rendering

v-if

The directive v-if is used to conditionally render a block. The block will only be rendered if the directive’s expression returns a truthy value.

  1. <h1 v-if="awesome">Vue is awesome!</h1>

It is also possible to add an “else block” with v-else:

  1. <h1 v-if="awesome">Vue is awesome!</h1>
  2. <h1 v-else>Oh no 😢</h1>

Conditional Groups with v-if on