storybook/docs/snippets/vue/list-story-unchecked.ts-2.ts.mdx
2022-11-30 20:25:47 +00:00

40 lines
1.0 KiB
Plaintext

```ts
// List.stories.ts
import List from './List.vue';
import ListItem from './ListItem.vue';
//👇 Imports a specific story from ListItem stories
import { Unchecked } from './ListItem.stories';
import type { Meta, StoryObj } from '@storybook/vue';
const meta: Meta<typeof List> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/7.0/vue/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'List',
component: List,
};
export default meta;
type Story = StoryObj<typeof List>;
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/7.0/vue/api/csf
* to learn how to use render functions.
*/
export const OneItem: Story = {
render: (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { List, ListItem },
template: '<List v-bind="$props"><ListItem v-bind="$props"/></List>',
}),
args: {
...Unchecked.args,
},
};
```