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

Junk props in $scopedSlots #9443

Closed

Comments

@IlyaKhD
Copy link

IlyaKhD commented Feb 6, 2019

Version

2.6.0

Reproduction link

https://codesandbox.io/s/5xx3jz48qn

Steps to reproduce

  • follow the codesandbox link attached
  • open the App.vue
  • see lines 13, and 19
  • see console output

What is expected?

$scopedSlots contains slot functions only (or empty if there are no slots at all)

What is actually happening?

$scopedSlots has _normalized and $stable fields


If these special props added to the $scopedSlots by intention - where can I find documentation on them?

@yyx990803
Copy link
Member

yyx990803 commented Feb 6, 2019

Do you have a legit case where you need to dynamically inspect slots being passed in? These are internal/special flags used for optimizations. Technically we can define them as non-enumerable.

@IlyaKhD
Copy link
Author

IlyaKhD commented Feb 6, 2019

Iterating through slots is used for integrating with 3rd-party libraries (here is an example of how slots are used to define 3rd-party templates)

So, as I got it - these props will remain and are for internal use only, right?

@yyx990803
Copy link
Member

Yes, if you have control over the implementation you can simply ignore anything that is not a function.

@IlyaKhD
Copy link
Author

IlyaKhD commented Feb 6, 2019

Ok
Thank you for clarification.

@IlyaKhD IlyaKhD closed this as completed Feb 6, 2019
Lostlover pushed a commit to Lostlover/vue that referenced this issue Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment