问题
I want to create stories using both Typescript and MDX, therefore I have in my main.js
:
module.exports = {
stories: ['../src/**/*.stories.(mdx|ts)'],
addons: ['@storybook/addon-docs', 'storybook-addon-preview']
};
However I don't want to have "Docs" tab next to "Canvas". How do I remove it? Without '@storybook/addon-docs'
MDX story is not displayed.
回答1:
Put this in preview.js
:
export const parameters = {
previewTabs: {
'storybook/docs/panel': {
hidden: true
}
}
};
Used in Storybook version 6.0.x
回答2:
I am currently using @storybook/angular@6.0.21
and the previous answer unfortunately did not work for me. I was able to find a solution in the storybook DocsPage documentation.
The relevant section:
You can replace DocsPage at any level by overriding the docs.page parameter:
- With null to remove docs
- With MDX docs
- With a custom React component
I was able to completely remove the DocsPage for a single story like this:
export const myStory = () => ({
moduleMetadata: MODULE_METADATA,
component: MyComponent,
});
myStory.parameters = {
docs: { page: null },
};
来源:https://stackoverflow.com/questions/63499683/hide-docs-tab-in-storybook