Defining fallthrough attributes #663
MichelJonkman
started this conversation in
General
Replies: 1 comment 1 reply
-
Duplicate of #479? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What problem does this feature solve?
Currently when you make a component that is made to accept fallthrough attributes it's not possible to define what those attributes are. A big use case is for "extending" existing components for instance:
This can be very annoying when an underlying component accepts a lot of different attributes. Of course if Volar implemented something for root elements it would help, but I believe a more declarative way would be a very good addition for when it's very hard or impossible for Volar to get the correct component.
What does the proposed API look like?
Following naming conventions I feel like adding a new function would be the best way, it would return the attributes just like useAttrs().
Alternatively something like this, but I'm not sure if something like PropsOf in the example exists already.
While this post focusses on fallthrough attributes, something to make the DX better for slots in the same use case would also be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions