storybook/docs/snippets/vue/component-story-with-custom-render-function.mdx.mdx
2021-10-19 18:19:00 +01:00

23 lines
533 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story } from 'storybook/addon-docs';
import MyComponent from './MyComponent.vue';
<Meta title="CustomRenderFunction" component= {MyComponent} />
<!-- This story uses a render function to fully control how the component renders. -->
<Story
name="ExampleWithRenderFunction"
render={() => ({
components: { MyComponent },
template: `
<div>
<h1>I'm a component with a custom render function</h1>
<MyComponent />
</div>
`,
})} />
```