mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:11:49 +08:00
32 lines
610 B
Plaintext
32 lines
610 B
Plaintext
```js
|
|
// MyComponent.stories.js
|
|
|
|
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
|
|
|
|
import MyComponent from './MyComponent.svelte';
|
|
|
|
export default {
|
|
component: MyComponent,
|
|
parameters: {
|
|
//👇 The viewports object from the Essentials addon
|
|
viewport: {
|
|
//👇 The viewports you want to use
|
|
viewports: INITIAL_VIEWPORTS,
|
|
//👇 Your own default viewport
|
|
defaultViewport: 'iphone6',
|
|
},
|
|
},
|
|
};
|
|
|
|
export const MyStory = {
|
|
render: () => ({
|
|
Component: MyComponent,
|
|
}),
|
|
parameters: {
|
|
viewport: {
|
|
defaultViewport: 'iphonex',
|
|
},
|
|
},
|
|
};
|
|
```
|