storybook/docs/snippets/vue/my-component-with-env-variables.mdx-3.mdx.mdx
2022-07-07 18:50:21 +01:00

30 lines
703 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Canvas, Meta, Story } from '@storybook/addon-docs';
import MyComponent from './MyComponent.vue';
<Meta title="MyComponent" component={MyComponent}/>
<!--
👇 Render functions are a framework specific feature to allow you control on how the component renders.
See https://storybook.js.org/docs/7.0/vue/api/csf
to learn how to use render functions.
-->
<Canvas>
<Story
name="ExampleStory"
args={{
propertyA: process.env.STORYBOOK_DATA_KEY,
}}
render={(args) => ({
components: { MyComponent },
setup() {
return { args };
},
template: '<MyComponent v-bind="args" />',
})} />
</Canvas>
```