mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 08:01:54 +08:00
38 lines
688 B
Plaintext
38 lines
688 B
Plaintext
```ts
|
|
// List.stories.ts
|
|
|
|
import { moduleMetadata } from '@storybook/angular';
|
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
import { List } from './list.component';
|
|
import { ListItem } from './list-item.component';
|
|
|
|
//👇 Imports a specific story from ListItem stories
|
|
import { Unchecked } from './ListItem.stories';
|
|
|
|
export default {
|
|
component: List,
|
|
decorators: [
|
|
moduleMetadata({
|
|
declarations: [ListItem],
|
|
imports: [CommonModule],
|
|
}),
|
|
],
|
|
};
|
|
|
|
export const OneItem = {
|
|
args: {
|
|
...Unchecked.args,
|
|
},
|
|
render: (args) => ({
|
|
props: args,
|
|
template: `
|
|
<list>
|
|
<list-item [item]="item"></list-item>
|
|
</list>
|
|
`,
|
|
}),
|
|
};
|
|
```
|