mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 07:21:16 +08:00
44 lines
1.3 KiB
Plaintext
44 lines
1.3 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/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;
|
|
|
|
|
|
const Template: Story = (args) => ({
|
|
props: args,
|
|
});
|
|
|
|
export const Simple = Template.bind({});
|
|
Simple.args = {
|
|
user: PageLayoutStories.PageLayoutSimple.args.user,
|
|
document: DocumentHeaderStories.DocumentHeaderSimple.args.document,
|
|
subdocuments: DocumentListStories.DocumentListSimple.args.documents
|
|
};
|
|
``` |