fbredius/storybook

View on GitHub
docs/snippets/vue/your-component.2.js.mdx

Summary

Maintainability
Test Coverage
```js
// YourComponent.stories.js

import YourComponent from './YourComponent.vue';

//πŸ‘‡ This default export determines where your story goes in the story list
export default {
  /* πŸ‘‡ The title prop is optional.
  * See https://storybook.js.org/docs/vue/configure/overview#configure-story-loading
  * to learn how to generate automatic titles
  */
  title: 'YourComponent',
  component: YourComponent,
};

//πŸ‘‡ We create a β€œtemplate” of how args map to rendering
const Template = (args, { argTypes }) => ({
  components: { YourComponent },
  props: Object.keys(argTypes),
  template: '<YourComponent v-bind="$props"/>',
});

export const FirstStory = Template.bind({});
FirstStory.args = {
  //πŸ‘‡ The args you need here will depend on your component
};
```