mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
- Rename `introduction.md`, `overview.md`, `how-to-contribute.md` pages -> `index.md` pages - Add all-new `index.md` pages for Sharing and API - Find/replace `introduction.md`/`overview.md` -> `index.md` - Find/replace `/introduction`/`/overview` -> `/` - Add `hideRendererSelector: true` to frontmatter of (some) pages that aren't conditional on renderer
43 lines
1.0 KiB
Plaintext
43 lines
1.0 KiB
Plaintext
```ts
|
|
// List.stories.js
|
|
|
|
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
|
|
import List from './List.vue';
|
|
import ListItem from './ListItem.vue';
|
|
|
|
//👇 Imports a specific story from ListItem stories
|
|
import { Unchecked } from './ListItem.stories';
|
|
|
|
const meta: Meta<typeof List> = {
|
|
/* 👇 The title prop is optional.
|
|
* See https://storybook.js.org/docs/configure/#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/api/csf
|
|
* to learn how to use render functions.
|
|
*/
|
|
export const OneItem: Story = {
|
|
render: (args) => ({
|
|
components: { List, ListItem },
|
|
setup() {
|
|
//👇 The args will now be passed down to the template
|
|
return { args };
|
|
},
|
|
template: '<List v-bind="args"><ListItem v-bind="args"/></List>',
|
|
}),
|
|
args: {
|
|
...Unchecked.args,
|
|
},
|
|
};
|
|
```
|