Replies: 1 comment 1 reply
-
|
@Mobyrr could you please share whether, when you have props and slots with the same name, it is because you use the prop as a fallback for the slot (or the other way around)? Storybook cannot have two args with the same name, as you pointed out, but renaming args in this instance could surprise users and even break existing code (e.g. you have a component with a I'm thinking that if we specifically want to support prop/slot fallback patterns, we could add a framework option to Vue to let users explicitly define which of the slot or prop receive the arg value when both exist. This would at least result in predictable behaviour even though it doesn't allow setting both the prop and slot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Right now, when a Vue component uses slots (default or named), they get mixed in with props in the args.
This becomes an issue when a component has both a slot called label and a prop also called label. In that case, there’s no way to decide whether you’re setting the prop or the slot, unless you fall back to custom rendering
Describe the solution you'd like
separating them with a props object and a slots object inside args
or by prefixing/suffixing slot args (label → labelSlot, for instance)
or letting the user choose the prefix/suffix
Describe alternatives you've considered
No response
Are you able to assist to bring the feature to reality?
no
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions