storybook/docs/snippets/vue/my-component-with-env-variables.3.js.mdx
2021-02-24 17:56:50 +00:00

23 lines
451 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) => ({
components: { MyComponent },
setup() {
return { args };
},
template: '<MyComponent v-bind="args"/>',
});
export const Default = Template.bind({});
Default.args = {
propertyA: process.env.STORYBOOK_DATA_KEY,
};
```