mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 09:22:09 +08:00
45 lines
809 B
Plaintext
45 lines
809 B
Plaintext
```js
|
|
// List.stories.js
|
|
|
|
import List from './ListComponent.vue';
|
|
import ListItem from './ListItem.vue';
|
|
|
|
export default {
|
|
component: List,
|
|
};
|
|
|
|
/*
|
|
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
* See https://storybook.js.org/docs/api/csf
|
|
* to learn how to use render functions.
|
|
*/
|
|
export const Empty = {
|
|
render: () => ({
|
|
components: { List },
|
|
template: '<List/>',
|
|
}),
|
|
};
|
|
|
|
export const OneItem = {
|
|
render: () => ({
|
|
components: { List, ListItem },
|
|
template: `
|
|
<List>
|
|
<list-item/>
|
|
</List>`,
|
|
}),
|
|
};
|
|
|
|
export const ManyItems = {
|
|
render: () => ({
|
|
components: { List, ListItem },
|
|
template: `
|
|
<List>
|
|
<list-item/>
|
|
<list-item/>
|
|
<list-item/>
|
|
</List>`,
|
|
}),
|
|
};
|
|
```
|