storybook/docs/snippets/vue/list-story-reuse-data.vue3.js.mdx
2021-02-23 00:26:03 +00:00

27 lines
642 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) => ({
components: { List, ListItem },
setup() {
return { args };
},
template: `
<list v-bind="args">
<list-item :itemProperty="Selected"/>
<list-item :itemProperty="Unselected"/>
<list-item :itemProperty="Unselected"/>
</list>
`,
});
ManyItems.args = {
Selected: Selected.args.itemProperty,
Unselected: Unselected.args.itemProperty,
};
```