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
Is your feature request related to a problem? Please describe.
When writing stories in Vue, each story must declare the component that it displays. This leads to a lot of repetition of the component name.
importSButtonfrom'./SButton.vue';exportdefault{title: 'Button'};exportconstloading=()=>({components: { SButton },// This is the same on every storytemplate: '<s-button loading>Manage</s-button>',});exportconstsmall=()=>({components: { SButton },// This is the same on every storytemplate: '<s-button size="small">Manage</s-button>',});
This is true of CSF and StoriesOf stories but I noticed that the default export of a CSF story has a component option. I had assumed that this would register the component globally (or scoped to the file?) and so I wouldn't need to register it for each story. Like this; export default { title: 'Button', component: SButton };
But unfortunately this didn't work as expected.
Describe the solution you'd like
Declaring a component on the default export means you don't have to add it to every story.
Describe alternatives you've considered
I considered making a small wrapper function at the top of my story file to do this for me. Something along the lines of;
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!
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if this is still relevant in SB 7.x.
Is your feature request related to a problem? Please describe.
When writing stories in Vue, each story must declare the component that it displays. This leads to a lot of repetition of the component name.
This is true of CSF and StoriesOf stories but I noticed that the default export of a CSF story has a
component
option. I had assumed that this would register the component globally (or scoped to the file?) and so I wouldn't need to register it for each story. Like this;export default { title: 'Button', component: SButton };
But unfortunately this didn't work as expected.
Describe the solution you'd like
Declaring a component on the default export means you don't have to add it to every story.
Describe alternatives you've considered
I considered making a small wrapper function at the top of my story file to do this for me. Something along the lines of;
Are you able to assist bring the feature to reality?
no
Additional context
Originally raised on Medium - https://medium.com/@matt.greenfield/this-looks-great-and-much-easier-to-use-thank-you-c560cf9865ba
Issue created as per response to that post.
The text was updated successfully, but these errors were encountered: