storybook/docs/snippets/vue/my-component-with-env-variables.vue2.js.mdx
2021-02-23 00:26:03 +00:00

21 lines
461 B
Plaintext

```js
// MyComponent.stories.js
import MyComponent from './MyComponent.vue';
export default {
component: MyComponent,
title: 'A story using environment variables inside a .env file',
};
const Template = (args, { argTypes }) => ({
components: { MyComponent },
props: Object.keys(argTypes),
template: '<MyComponent v-bind="$props"/>',
});
export const Default = Template.bind({});
Default.args = {
propertyA: process.env.STORYBOOK_DATA_KEY,
};
```