-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
Description
Here is a list rendering using a custom component and the v-once directive:
<li v-for="item of items" :key="item.model.id">
<item :model="item.model" v-once></item>
</li>JsFiddle using [email protected]
Note that this does not work using [email protected], unless we remove the v-once directive.
Now let's add a conditional rendering:
<li v-for="item of items" :key="item.model.id">
<span v-if="item.model.id===1">BOB</span>
<item :model="item.model" v-else v-once></item>
</li>JsFiddle using [email protected]
JsFiddle using [email protected]
This fails using [email protected] with the error:
Property or method "item" is not defined on the instance but referenced during render.
but works with 2.0.3 (2.0.3 failed when there was no v-else)