storybook/docs/snippets/vue/my-component-story-configure-viewports.mdx.mdx
2021-11-04 21:07:00 +00:00

34 lines
561 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import MyComponent from './MyComponent.vue';
<Meta
title="MyComponent"
parameters={{
viewport: {
viewports: INITIAL_VIEWPORTS,
defaultViewport: 'iphone6',
},
}}
component={MyComponent}
/>
<Story
name="MyStory"
parameters={{
viewport: {
defaultViewport: 'iphonex',
}
}}>
{() => {
return {
template: `<MyComponent />`,
};
}}
</Story>
```