-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
Description
Here is an example https://jsfiddle.net/h6azrhhz/
Template:
<section>
<template v-if="false">
</template>
<template v-else>
<div v-if="condition" class="my-class">I'm loading</div>
<div v-else>I'm loaded</div>
</template>
</section>
If v-if v-else block nested into another v-if, it produces error
VM205 vue.js:427TypeError: Cannot read property 'attrs' of undefined
when switching value of condition
.
As i researched, need 3 conditions to reproduce the issue
- Class attr (or another attribute) must be presented presented in nested element
- Nested v-else must be presented
- v-if v-else must be nested into another v-if v-else
Workaround is to use v-if="condition" and v-if="!condition" instead of v-else
Thanks