mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:11:29 +08:00
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
```ts
|
|
// YourPage.stories.ts
|
|
|
|
import { moduleMetadata } from '@storybook/angular'
|
|
import { Story, Meta } from '@storybook/angular/types-6-0';
|
|
|
|
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 {
|
|
component: DocumentScreen,
|
|
title: 'DocumentScreen',
|
|
decorators: [
|
|
moduleMetadata({
|
|
// imports components to allow component composition with Storybook
|
|
declarations: [DocumentList, DocumentHeader,PageLayout],
|
|
imports: [CommonModule],
|
|
}),
|
|
],
|
|
} as Meta;
|
|
|
|
const Template: Story<DocumentScreen> = (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
|
|
};
|
|
``` |