storybook/docs/snippets/vue/list-story-expanded.ts-2.ts.mdx

41 lines
1.0 KiB
Plaintext

```ts
// List.stories.ts
import List from './ListComponent.vue';
import ListItem from './ListItem.vue';
import { Meta, StoryFn } from '@storybook/vue';
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,
} as Meta<typeof List>;
export const Empty: StoryFn<typeof List> = (args, { argTypes }) => ({
components: { List },
props: Object.keys(argTypes),
template: '<list v-bind="$props"/>',
});
export const OneItem: StoryFn<typeof List> = (args, { argTypes }) => ({
components: { List, ListItem },
props: Object.keys(argTypes),
template: '<list v-bind="$props"><list-item/></list>',
});
export const ManyItems: StoryFn<typeof List> = (args, { argTypes }) => ({
components: { List, ListItem },
props: Object.keys(argTypes),
template: `
<list v-bind="$props">
<list-item/>
<list-item/>
<list-item/>
</list>
`,
});
```