tres
tres copied to clipboard
When using a v-for inside a component slot it doesn't remove the last item
Describe the bug
Creating elements using a v-for inside a component slot will not remove the last item
CompB:
<template>
<slot></slot>
</template>
CompA:
<CompB>
<!-- the last mesh will not be removed when all items of array items are removed -->
<TresMesh v-for="item in items">
...
</TresMesh>
</CompB >
Reproduction
https://stackblitz.com/edit/tresjs-minimal-reproduction-qyy6kmyp?file=src%2FApp.vue
Steps to reproduce
Press the add item button press the "Remove Item" until items total is 0 the last box should be removed
System Info
Used Package Manager
npm
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
- [x] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] The provided reproduction is a minimal reproducible example of the bug.
Have you tried adding the key attribute to v-for? For example, like this:
<ul>
<li v-for="item in items" :key="item.id">...</li>
</ul>