storybook/docs/snippets/vue/my-component-with-env-variables.mdx-2.mdx.mdx
2021-11-06 03:20:29 +00:00

25 lines
525 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Canvas, Meta, Story } from '@storybook/addon-docs';
import MyComponent from './MyComponent.vue';
<Meta title="MyComponent" component={MyComponent}/>
export const Template = (args, { argTypes }) => ({
components: { MyComponent },
props: Object.keys(argTypes),
template: '<MyComponent v-bind="$props"/>',
});
<Canvas>
<Story
name="ExampleStory"
args={{
propertyA: process.env.STORYBOOK_DATA_KEY,
}}>
{Template.bind({})}
</Story>
</Canvas>
```