v-else
-
Does not expect expression
-
Restriction: previous sibling element must have
v-if
orv-show
. -
Usage:
Denote the “else block” for
v-if
andv-show
.<div v-if="Math.random() > 0.5"> Sorry </div> <div v-else> Not sorry </div>
-
See also: Conditional Rendering - v-else
- See also: Conditional Rendering - Component caveat
Please login to continue.