storybook/docs/snippets/vue/component-story-static-asset-with-import.mdx-3.mdx.mdx
2021-08-08 18:33:11 +01:00

25 lines
391 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import imageFile from './static/image.png'
<Meta title='img' />
export const image = {
src: imageFile,
alt: "my image",
};
<Story name='withAnImage'>
{() => {
return {
setup() {
return { image };
},
template: `<img v-bind="image"/>`,
};
}}
</Story>
```