storybook/docs/snippets/vue/component-story-static-asset-with-import.mdx-2.mdx.mdx
2021-08-09 19:19:01 +01:00

30 lines
495 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 {
template: `<img :src="src" :alt="alt"/>`,
props: {
src: {
default: () => image.src,
},
alt: {
default: () => image.alt,
},
},
};
}}
</Story>
```