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

Scoped Slot delegate to child component. Slot is in child component always set, also if it not set #8936

Closed
MaximilianFranke opened this issue Oct 11, 2018 · 2 comments

Comments

@MaximilianFranke
Copy link

Version

2.5.17

Reproduction link

https://codesandbox.io/s/j1451yzrm5

Steps to reproduce

Open sample

What is expected?

The output of the second sample should be:
....
Child component...has scopedslot: false
....

What is actually happening?

The output of the second sample is:
....
Child component...has scopedslot: true
....

@MaximilianFranke MaximilianFranke changed the title Scoped Slot delegate to child component Scoped Slot delegate to child component. Slot is in child component always set, also if it not set Oct 11, 2018
@MaximilianFranke
Copy link
Author

also interesting if you remove the v-if in Parent.vue the default of the basicslot is still rendered but the default of the scopedslot isn't anymore.

@posva
Copy link
Member

posva commented Oct 11, 2018

It's because it's a function, so you have to call it to check if the result is undefined (or an empty array in the future #8056). In the Parent component there's always the scoped slot in the template but that's not the case in App.vue, so the function may also not exist

@posva posva closed this as completed Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants