storybook/docs/snippets/vue/my-component-with-env-variables.mdx-2.mdx.mdx
2022-07-07 18:50:21 +01:00

28 lines
704 B
Plaintext

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