storybook/docs/snippets/vue/my-component-with-env-variables.mdx-3.mdx.mdx
2021-08-08 18:33:11 +01:00

28 lines
612 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story, Canvas } from '@storybook/addon-docs';
import MyComponent from './MyComponent.vue';
<Meta title='A MDX story using environment variables inside a .env file' component={MyComponent}/>
export const Template = (args) => ({
components: { MyComponent },
setup() {
return { args };
},
template: '<MyComponent v-bind="args" />',
});
<Canvas>
<Story
name='A MDX story using environment variables inside a .env file'
args={{
propertyA: process.env.STORYBOOK_DATA_KEY,
}}
>
{Template.bind({})}
</Story>
</Canvas>
```