storybook/docs/snippets/vue/my-component-with-env-variables.mdx-3.mdx.mdx
2021-11-06 03:20:29 +00:00

27 lines
516 B
Plaintext

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