Simon Brodie
5
Q:

vue v-if

<!-- 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.
-->
5
<span v-for="role in user.roles">
    <span v-if="role.name == 'Admin'">Yes</span>
    <span v-else>-</span>
</span>
0
<div v-if="Math.random() > 0.5">
  Now you see me
</div>
<div v-else>
  Now you don't
</div>
1
<h1 v-if="variable">Vue is awesome!</h1>
0
<ul>
  <li v-for="(item, index) in items">
    {{ index }} - {{ item }}
  </li>
</ul>
0

New to Communities?

Join the community