mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 23:02:00 +08:00
25 lines
391 B
Plaintext
25 lines
391 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 {
|
|
setup() {
|
|
return { image };
|
|
},
|
|
template: `<img v-bind="image"/>`,
|
|
};
|
|
}}
|
|
</Story>
|
|
``` |