1.0.26
https://jsfiddle.net/koshpavel/3vh62y7r/
All explanations are in the output
Expected to not show
it's expected behavior.
v-for has higher priority than v-if
v-if in this case applies to each element which produces a v-for
Hi @PavelTytyuk
Adding to what @repsac-by explained, you can make it work by putting the v-if on a seperate element, like this:
<ul v-if="contracts.length > 0">
<li v-for="contract in contracts">
{{ contract }}
</li>
</ul>
<div v-else>
No contracts (now shown as expected)
</div>
Most helpful comment
it's expected behavior.
v-forhas higher priority thanv-ifv-ifin this case applies to each element which produces av-for