storybookjs/storybook

How to show viewport on the docs page?

开放

#9,218 创建于 2019年12月22日

 (2 条评论) (16 个反应) (0 位负责人)TypeScript (10,058 个派生)batch import
addon: docsaddon: viewporthelp wantedmediumtriage:reviewed

仓库指标

星标
 (89,909 个星标)
PR 合并指标
 (平均合并 7天 22小时) (30 天内合并 184 个 PR)

描述

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
    }
})

贡献者指南