storybook/docs/snippets/vue/component-story-static-asset-with-import.mdx-2.mdx.mdx
2021-11-06 03:20:29 +00:00

31 lines
521 B
Plaintext

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