mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
25 lines
501 B
Plaintext
25 lines
501 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",
|
|
};
|
|
|
|
<!-- Render functions are a framework specific feature to allow you control on how the component renders -->
|
|
|
|
<Story
|
|
name="withAnImage"
|
|
render={() => ({
|
|
setup() {
|
|
return { image };
|
|
},
|
|
template: `<img v-bind="image"/>`,
|
|
})} />
|
|
``` |