Vue: slot is reused with v-if/v-else

Created on 9 Sep 2020  ·  5Comments  ·  Source: vuejs/vue

Version

2.6.12

Reproduction link

https://codepen.io/jiankafei/pen/jOqZdpG

Steps to reproduce

Click the switch button, it will switch between two components with slots and without slots. The components without slots should not appear the slots passed to the components with slots

What is expected?

Should display the fallback slot

What is actually happening?

Displays the previous slot


bug has PR has workaround

Most helpful comment

as long as no PR has been submitted anybody can take any bug and give it a try 🙂

All 5 comments

The workaround is to use a key on alert-box so Vue doesn't reuse it

@jacekkarczmarczyk @posva 三克油

hmm, this bug should be fixed, if yes, can i take this? :)

as long as no PR has been submitted anybody can take any bug and give it a try 🙂

Was this page helpful?
0 / 5 - 0 ratings