fbredius/storybook

View on GitHub
docs/snippets/vue/list-story-unchecked.3.js.mdx

Summary

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

import List from './List.vue';
import ListItem from './ListItem.vue';

//👇 Imports a specific story from ListItem stories
import { Unchecked } from './ListItem.stories';

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: 'List',
  component: List,
};

export const OneItem = (args) => ({
  components: { List, ListItem },
  setup() {
    //👇 The args will now be passed down to the template
    return { args };
  },
  template: `
    <List v-bind="args">
      <ListItem v-bind="args"/>
    </List>
  `,
});
OneItem.args = {
  ...Unchecked.args,
};
```