Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slot is reused with v-if/v-else #11652

Closed
jiankafei opened this issue Sep 9, 2020 · 5 comments · Fixed by #11795
Closed

slot is reused with v-if/v-else #11652

jiankafei opened this issue Sep 9, 2020 · 5 comments · Fixed by #11795

Comments

@jiankafei
Copy link

jiankafei commented Sep 9, 2020

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


@jacekkarczmarczyk
Copy link

@posva posva changed the title $scopedSlots 没有更新 slot is reused with v-if/v-else Sep 9, 2020
@posva
Copy link
Member

posva commented Sep 9, 2020

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

@jiankafei
Copy link
Author

@jacekkarczmarczyk @posva 三克油

@piotrzarycki
Copy link

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

@posva
Copy link
Member

posva commented Sep 10, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants