mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:21:49 +08:00
25 lines
384 B
Plaintext
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"/>`,
|
|
}),
|
|
};
|
|
```
|