Today I encountered a rather peculiar issue that I would like to share here:
I noticed that when using v-for and v-if together with data value of []
, it doesn't seem to work. For example:
ts: []
<div v-for="t in ts" :key="t" v-if="ts.length">
Yes
</div>
<div v-else>
No
</div>
You can check out the problem in action on codesandbox.
As seen, nothing gets rendered and no errors are thrown. I even attempted using v-if="ts.length > 0"
but had no luck.