storybook/docs/snippets/vue/my-component-with-env-variables.js.mdx

21 lines
454 B
Plaintext

```js
// MyComponent.stories.js
import MyComponent from './MyComponent';
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
};
```