You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request, whilst solving some issues, seems to have included a bug that causes code snippets to generate incorrect code if a prop has the same key as a slot.
I am using Storybook (7.1.0-alpha-42) with Vue 3 (3.3.4) and PrimeVue component library (3.29.2).
This is happening with the use of the Button component which has an 'icon' prop and an 'icon' slot. If I were to take a guess I'd think that the slot and prop having the same name is causing the problem.
The text was updated successfully, but these errors were encountered:
rstainsby
changed the title
Code snippets not working correctly when prop and slot have same name (7.1.0-alpha-42)
Code snippets not working correctly when prop and slot have same name (7.1.0-alpha-42)(Vue 3)
Jul 16, 2023
@rstainsby yes i'm aware of this issue, this limitation comes from the initial CSF API Design that may work for some renderer like React because React uses children to pass the slots, but may create a conflict. for vue as vue separate props and slots.
means. in vue you can have same name for slots and props without any issue but storybook args = { ... props , ...slots } which show clearly the limitation we have here.
The Issue
This pull request, whilst solving some issues, seems to have included a bug that causes code snippets to generate incorrect code if a prop has the same key as a slot.
Example
For example, I have the following story:
which outputs this code snippet:
where, in previous versions, it output:
Project Setup
I am using Storybook (7.1.0-alpha-42) with Vue 3 (3.3.4) and PrimeVue component library (3.29.2).
This is happening with the use of the Button component which has an 'icon' prop and an 'icon' slot. If I were to take a guess I'd think that the slot and prop having the same name is causing the problem.
Here's the API for the component https://primevue.org/button/.
Happy to send across full file's if it makes things easier.
Originally posted by @rstainsby in #22518 (comment)
The text was updated successfully, but these errors were encountered: