mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:01:21 +08:00
41 lines
904 B
Plaintext
41 lines
904 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';
|
|
|
|
//👇 We're importing the necessary stories from ListItem
|
|
import { Selected, Unselected } from './ListItem.stories';
|
|
|
|
export default {
|
|
component: List,
|
|
decorators: [
|
|
moduleMetadata({
|
|
declarations: [List, ListItem],
|
|
imports: [CommonModule],
|
|
}),
|
|
],
|
|
};
|
|
|
|
export const ManyItems = {
|
|
args: {
|
|
Selected: Selected.args.isSelected,
|
|
Unselected: Unselected.args.isSelected,
|
|
},
|
|
render: (args) => ({
|
|
props: args,
|
|
template: `
|
|
<list>
|
|
<list-item [isSelected]="Selected"></list-item>
|
|
<list-item [isSelected]="Unselected"></list-item>
|
|
<list-item [isSelected]="Unselected"></list-item>
|
|
</app-list>
|
|
`,
|
|
}),
|
|
};
|
|
```
|