特性
父级: main.js|ts 配置
类型
{
actions?: boolean;
angularFilterNonInputControls?: boolean;
argTypeTargetsV7?: boolean;
backgrounds?: boolean;
controls?: boolean;
developmentModeForBuild?: boolean;
highlight?: boolean;
interactions?: boolean;
legacyDecoratorFileOrder?: boolean;
measure?: boolean;
outline?: boolean;
toolbars?: boolean;
viewport?: boolean;
}
启用 Storybook 的附加特性。
actions
类型: boolean
启用 Actions 特性。
angularFilterNonInputControls
类型: boolean
过滤 Angular 中的非输入控件。
argTypeTargetsV7
(⚠️ 实验性)
类型: boolean
根据渲染函数中的类型过滤带有 "target" 的 Args。
.storybook/main.ts
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
import type { StorybookConfig } from '@storybook/your-framework';
const config: StorybookConfig = {
framework: '@storybook/your-framework',
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
features: {
argTypeTargetsV7: true,
},
};
export default config;
backgrounds
类型: boolean
启用 背景 特性。
controls
类型: boolean
启用 Controls 特性。
developmentModeForBuild
类型: boolean
在构建的 Storybook 中将 NODE_ENV
设置为 'development'
,以获得更好的测试和调试能力。
.storybook/main.ts
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
import type { StorybookConfig } from '@storybook/your-framework';
const config: StorybookConfig = {
framework: '@storybook/your-framework',
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
features: {
developmentModeForBuild: true,
},
};
export default config;
highlight
类型: boolean
启用 高亮 特性。
interactions
类型: boolean
启用 交互 特性。
legacyDecoratorFileOrder
类型: boolean
在应用插件或框架的装饰器之前,先应用来自 preview.js 的装饰器。更多信息。
.storybook/main.ts
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
import type { StorybookConfig } from '@storybook/your-framework';
const config: StorybookConfig = {
framework: '@storybook/your-framework',
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
features: {
legacyDecoratorFileOrder: true,
},
};
export default config;
measure
类型: boolean
启用 测量 特性。
outline
类型: boolean
启用 轮廓 特性。
toolbars
类型: boolean
启用 工具栏 特性。
viewport
类型: boolean
启用 视口 特性。