mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 18:01:51 +08:00
43 lines
812 B
Plaintext
43 lines
812 B
Plaintext
```js
|
|
// List.stories.js
|
|
|
|
import List from './ListComponent.vue';
|
|
import ListItem from './ListItem.vue';
|
|
|
|
export default {
|
|
component: List,
|
|
};
|
|
|
|
export const Empty = {
|
|
render: (args, { argTypes }) => ({
|
|
components: { List },
|
|
props: Object.keys(argTypes),
|
|
template: '<List v-bind="$props"/>',
|
|
}),
|
|
};
|
|
|
|
export const OneItem = {
|
|
render: (args, { argTypes }) => ({
|
|
components: { List, ListItem },
|
|
props: Object.keys(argTypes),
|
|
template: `
|
|
<List v-bind="$props">
|
|
<list-item/>
|
|
</List>`,
|
|
}),
|
|
};
|
|
|
|
export const ManyItems = {
|
|
render: (args, { argTypes }) => ({
|
|
components: { List, ListItem },
|
|
props: Object.keys(argTypes),
|
|
template: `
|
|
<List v-bind="$props">
|
|
<list-item/>
|
|
<list-item/>
|
|
<list-item/>
|
|
</List>`,
|
|
}),
|
|
};
|
|
```
|