storybookjs/storybook

How to show viewport on the docs page?

Open

#9,218 建立於 2019年12月22日

在 GitHub 查看
 (2 留言) (16 反應) (0 負責人)TypeScript (89,909 star) (10,058 fork)batch import
addon: docsaddon: viewporthelp wantedmediumtriage:reviewed

描述

Describe the bug How to show viewport on the docs page? The canvas page has viewport options,But the documentation page is not。Is this a bug or does it require additional configuration?

Screenshots The canvas page has viewport options. image

But the documentation page is not。 image

Code snippets

import { configure, addParameters } from '@storybook/react'
import { DocsPage, DocsContainer } from '@storybook/addon-docs/blocks'
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'
import '../src/index.less'

addParameters({
    viewport: {
        viewports: INITIAL_VIEWPORTS
    },
    docs: {
        container: DocsContainer,
        page: DocsPage
    }
})

貢獻者指南