vue v-if
snippet in html

vue v-if

user2603

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

vuejs v-for array index

user939

<!-- To gain access to the array index: -->
<ul>
    <li v-for="(game, index) in games"></li>
</ul>
<!--
	You only want the index in specific cases. Use `:key` as
	standard. See the other greps.
-->

vue v-if compare string

user5802

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

v-for

user347

<ul>
  <li v-for="(item, index) in items">
    {{ index }} - {{ item }}
  </li>
</ul>

vue if

user6554

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

v-if vuejs

user603

<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>