storybook/docs/snippets/vue/component-story-static-asset-with-import.2.js.mdx
2021-09-06 22:03:15 +01:00

29 lines
411 B
Plaintext

```js
// MyComponent.stories.js
import imageFile from './static/image.png';
export default {
title: 'img',
};
const image = {
src: imageFile,
alt: 'my image',
};
export const WithAnImage = {
render: () => ({
props: {
src: {
default: () => image.src,
},
alt: {
default: () => image.alt,
},
},
template: `<img :src="src" :alt="alt"/>`,
}),
};
```