Repository navigation
Props in a story are not passed if they're named the same way as in the Vue component #23
Description
Activity
Automention: Hey @Armanio @backbone87 @elevatebart @leoyli @pksunkara @pocka, you've been tagged! Can you give a hand here?
Any chance you could set up a codepen, or a repo with a minimal reproduction of this behavior?
I'm running into this right now – checking within the next days :)
I've reproduced this here: https://github.com/HerrBertling/nuxt-ts-storybook-docs-issue –
although I'm not usingThe deployed Storybook can be found here: https://competent-beaver-af1f48.netlify.app/addon-knobsbut out of the boxcontrols.All buttons have the same (default) values, although I've added specific variants viaTemplate.bind({…}).My issue might be different since it's using controls, but it seems to me that this is the same root issue (since controls should™ use the exact same naming convention)EDIT: @tzhelyazkova I've added your case to the repo, it's also within the deployed storybook within the next minutes 😊
Reacted by Tonina ZhelyazkovaReacted by Andrej BöttcherTurns out: If I actually use the correct setup for the controls/args stuff, it works as expected (=> HerrBertling/nuxt-ts-storybook-docs-issue@7dd04d8 ) – the knobs issue remains, though.
I'll check that next since I'll most certainly run into this as well.
@HerrBertling i'd recommend using controls/args instead of knobs
Reacted by Markus Siering@HerrBertling i'd recommend using controls/args instead of knobs
That would definitely solve the problem and also solve this issue @tzhelyazkova – maybe it's a solution for you as well? You can see the correct usage here: https://github.com/HerrBertling/nuxt-ts-storybook-docs-issue/blob/main/components/MyButton/MyButton.stories.js
Reacted by Tonina ZhelyazkovaI'm also experiencing this issue. I only see the behaviour occurring on the select knob - text, number, boolean and object are working fine for me.
After a little investigation it looks to me like knobs and docs are conflicting with each other in some way, as either removing the
component: MyComponentfrom the story's default export or removing the docs addon entirely seems to make the select knob work again. This is obviously not a solution but might be useful info?Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Describe the bug
Naming a prop in a story the same way the component's prop is named leads to a broken state where the property value is not passed to the component.
Both the story and the vue component use TypeScript.
Workaround
Naming the prop in the story differently from the respective prop in the component works.
To Reproduce
template: '<Button :type="type" />'Expected behavior
The prop value is passed to the component.
Code snippets
System:
I cannot think of anything wrong with either the Vue component or the story itself.