mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 16:11:33 +08:00
40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
```ts
|
|
// YourPage.stories.ts
|
|
|
|
import { Meta, moduleMetadata, Story } from '@storybook/angular';
|
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
import { DocumentScreen } from './YourPage.component';
|
|
import { DocumentList } from './DocumentList.component';
|
|
import { DocumentHeader } from './DocumentHeader.component';
|
|
import { PageLayout } from './PageLayout.component';
|
|
|
|
//👇 Imports the required stories
|
|
import * as PageLayoutStories from './PageLayout.stories';
|
|
import * as DocumentHeaderStories from './DocumentHeader.stories';
|
|
import * as DocumentListStories from './DocumentList.stories';
|
|
|
|
export default {
|
|
/* 👇 The title prop is optional.
|
|
* See https://storybook.js.org/docs/7.0/angular/configure/overview#configure-story-loading
|
|
* to learn how to generate automatic titles
|
|
*/
|
|
title: 'DocumentScreen',
|
|
component: DocumentScreen,
|
|
decorators: [
|
|
moduleMetadata({
|
|
declarations: [DocumentList, DocumentHeader, PageLayout],
|
|
imports: [CommonModule],
|
|
}),
|
|
],
|
|
} as Meta;
|
|
|
|
export const ExampleWithRole: Story = {
|
|
args: {
|
|
user: PageLayoutStories.PageLayoutSimple.args.user,
|
|
document: DocumentHeaderStories.DocumentHeaderSimple.args.document,
|
|
subdocuments: DocumentListStories.DocumentListSimple.args.documents,
|
|
},
|
|
};
|
|
``` |