storybook/docs/snippets/vue/page-story-with-args-composition.3.js.mdx
2022-07-07 18:50:21 +01:00

39 lines
1.1 KiB
Plaintext

```js
// YourPage.stories.js
import DocumentScreen from './YourPage.vue';
//👇 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/vue/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'DocumentScreen',
component: DocumentScreen,
};
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/7.0/vue/api/csf
* to learn how to use render functions.
*/
export const Simple = {
render: (args) => ({
components: { DocumentScreen },
setup() {
return { args };
},
template: '<DocumentScreen v-bind="args" />',
}),
args: {
user: PageLayoutStories.Simple.args.user,
document: DocumentHeaderStories.Simple.args.document,
subdocuments: DocumentListStories.Simple.args.documents,
},
};
```