Switching between slot children's children that have `v-if` does not update dom
Version
3.0.11
Reproduction link
https://jsfiddle.net/Lrnebjuv/24/
Steps to reproduce
- Click button "Click me" multiple times
What is expected?
Text below button should show 1, 2, 3 in a loop
What is actually happening?
Text shows 1, 1, 3 instead
Also happens without .children.default()
using <slot></slot>
instead in this variant https://jsfiddle.net/Lrnebjuv/25/
Original context is a tab component: https://github.com/rashfael/buntpapier/issues/22 https://github.com/rashfael/buntpapier/blob/vue3/src/tabs.js
as a workaround add key
to p
:
<Bar>
<p key="1" v-if="true">
1
</p>
</Bar>
<Bar>
<p key="2" v-if="true">
2
</p>
</Bar>
201060717d4498b4b7933bf8a8513866ab9347e4 is a partial fix which does not fix the <slot/>
variant