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

25 lines
384 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: () => ({
setup() {
//👇 Returns the content of the image object create above.
return { image };
},
template: `<img v-bind="image"/>`,
}),
};
```