Answers for "if then + vuejs"

1

if else if vue

<div v-if="type === 'A'">
  A
</div>
<div v-else-if="type === 'B'">
  B
</div>
<div v-else-if="type === 'C'">
  C
</div>
<div v-else>
  No A, B or C
</div>
Posted by: Guest on March-11-2021
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

Browse Popular Code Answers by Language