Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue: Use parameters.component if available #8685

Closed
shilman opened this issue Nov 3, 2019 · 2 comments
Closed

Vue: Use parameters.component if available #8685

shilman opened this issue Nov 3, 2019 · 2 comments

Comments

@shilman
Copy link
Member

shilman commented Nov 3, 2019

In Vue stories, you currently need to pass a component argument as part of the story input (for some modes):

export const basic = () => ({
  components: { InfoButton },
  template: '<info-button label="I\'m a button!"/>',
});

However, in 5.2 and later, it's recommended to pass this as part of the component metadata:

export default {
  title: 'InfoButton',
  component: InfoButton,
};

This gets translated into the underlying API call:

storiesOf('InfoButton', module)
  .addParameters({ component: InfoButton })
  .add('Basic', () => ...);

Therefore Vue should use parameters.component if it's available and the story's component ISN'T available. If possible, in 6.0 we should deprecate the Story's component, and in 7.0 we should remove support entirely.

Related: #8673

@pksunkara
Copy link
Member

@shilman Should you close #8109 because they look the same?

@storybookjs storybookjs deleted a comment from stale bot Jan 15, 2020
@shilman
Copy link
Member Author

shilman commented Jan 15, 2020

@pksunkara good call. closing this issue instead as dupe to #8109, since that one already has upvotes.

@shilman shilman closed this as completed Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants