v-if vuejs
snippet in html

vue v-if

user1922

<div v-if="Math.random() > 0.5">
  Now you see me
</div>
<div v-else>
  Now you don't
</div>

vue v-if compare string

user5940

<span v-for="role in user.roles">
    <span v-if="role.name == 'Admin'">Yes</span>
    <span v-else>-</span>
</span>

vue if

user8829

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

v-if vuejs

user5500

<h1 v-if="awesome">Vue is awesome !</h1>
<h1 v-else-if="sowSow">Vue is not very nice !</h1>
<h1 v-else>Vue is baaaad !</h1>