-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
Being aware of scoped slots types based on data from parent (typescript) #439
Comments
Hi @chojnicki, in short vue can't support this for now. But you can do it with some hack ways by volar (I don't recommend it). See: |
@johnsoncodehk This hacky workaround will not work in my case :( Event if this cant be automatically detected by Volar it would be great to be at least able assert type inside like But thanks anyway for detailed answer! |
Let we wait for vuejs/core#1359 :) |
@johnsoncodehk sorry to comment on a closed issue. My parent has the scope it passes to the slot typed correctly: but this is still not recognised by the child: my feature request would be:
Should I create a new FR issue for this? Best regards. |
Hi @mesqueeb, this feature has been temporarily deprecated since v0.34.0. See: |
Just for record, this feature is back at v0.36.0 (only for script setup): https://github.com/johnsoncodehk/volar/blob/master/CHANGELOG.md#0360-202263 |
Hi. Here's simple reproduction of scoped slots implementation (of course in this form it does not make any sense, it's just to show the problem).
DemoParent.vue
DemoChild.vue
It's good that extension can detect in parent component type of
slotProps
based on types defined inside child component, soslotProps.item
as string in this example. BUT in parent I'm passing not just any string but with certain type, so I need to know that returned slot prop is also in that type.In real world example I have universal components for table and columns and it works just great on browser but in IDE I'm losing any information of passed data types which is bad.
Any ideas for workarounds or could this be supported by extension?
Regards!
The text was updated successfully, but these errors were encountered: