storybook/docs/snippets/vue/list-story-reuse-data.2.js.mdx
2021-02-24 17:56:50 +00:00

25 lines
652 B
Plaintext

```js
// List.stories.js
import List from './ListComponent.vue';
import ListItem from './ListItem.vue';
//👇 We're importing the necessary stories from ListItem
import { Selected, Unselected } from './ListItem.stories';
export const ManyItems = (args, { argTypes }) => ({
components: { List, ListItem },
props: Object.keys(argTypes),
template: `
<list v-bind="$props">
<list-item :itemProperty="Selected"/>
<list-item :itemProperty="Unselected"/>
<list-item :itemProperty="Unselected"/>
</list>
`,
});
ManyItems.args = {
Selected: Selected.args.itemProperty,
Unselected: Unselected.args.itemProperty,
};
```