Answers for "conditional redering vue"

5

vue v-if

<div v-if="Math.random() > 0.5">
  Now you see me
</div>
<div v-else>
  Now you don't
</div>
Posted by: Guest on March-04-2020
0

vue v-if compare string

<span v-for="role in user.roles">
    <span v-if="role.name == 'Admin'">Yes</span>
    <span v-else>-</span>
</span>
Posted by: Guest on June-04-2020

Browse Popular Code Answers by Language