From a9e709e9c9eaba26d001bd0d8772d668c48f27ba Mon Sep 17 00:00:00 2001 From: liuxy0551 Date: Mon, 5 Aug 2024 10:59:00 +0800 Subject: [PATCH] docs: blockHeader docs use size --- .../__tests__/blockHeader.test.tsx | 4 +-- src/blockHeader/index.md | 30 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/blockHeader/__tests__/blockHeader.test.tsx b/src/blockHeader/__tests__/blockHeader.test.tsx index c31ef0559..f1318c85c 100644 --- a/src/blockHeader/__tests__/blockHeader.test.tsx +++ b/src/blockHeader/__tests__/blockHeader.test.tsx @@ -90,13 +90,13 @@ describe('test BlockHeader render', () => { expect(getByText('说明文字')).toHaveClass(`${prefixCls}-after-title`); expect(getByText('Icon')).toBeTruthy(); }); - test('should render BlockHeader className when isSmall is small', () => { + test('should render BlockHeader props without background', () => { const props = { title: '测试1', showBackground: false }; const { container } = render(); const wrap = container.firstChild; expect(wrap!.firstChild).not.toHaveClass(`background`); }); - test('should render BlockHeader className when isSmall is small', () => { + test('should render BlockHeader className when size is small', () => { const { container, getByText } = render(); const wrap = container.firstChild!; expect(wrap).toHaveClass(`${prefixCls}`); diff --git a/src/blockHeader/index.md b/src/blockHeader/index.md index b1fb9fc8a..f6f159e92 100644 --- a/src/blockHeader/index.md +++ b/src/blockHeader/index.md @@ -27,18 +27,18 @@ demo: ### BlockHeader -| 参数 | 说明 | 类型 | 默认值 | -| ----------------- | ----------------------------------------- | --------------------------- | ------- | -| title | 标题 | `React.ReactNode` | - | -| beforeTitle | 标题前的图标,默认是一个色块 | `React.ReactNode` | - | -| afterTitle | 标题后的提示图标或文案 | `React.ReactNode` | - | -| tooltip | 默认展示问号提示(优先级低于 `afterTitle`) | `React.ReactNode` | - | -| isSmall | 大标题、小标题,默认为大标题 | `boolean` | `false` | -| titleRowClassName | 标题一行的样式类名 | `string` | - | -| titleClassName | 标题的样式类名 | `string` | - | -| showBackground | 是否显示背景 | `boolean` | `true` | -| defaultExpand | 是否默认展开内容 | `boolean` | `true` | -| hasBottom | 是否有默认下边距 16px | `boolean` | `false` | -| spaceBottom | 自定义下边距,优先级高于 hasBottom | `number` | `0` | -| children | 展开/收起的内容 | `React.ReactNode` | - | -| onChange | 展开/收起时的回调 | `(expand: boolean) => void` | - | +| 参数 | 说明 | 类型 | 默认值 | +| ----------------- | ----------------------------------------- | --------------------------- | -------- | -------- | +| title | 标题 | `React.ReactNode` | - | +| beforeTitle | 标题前的图标,默认是一个色块 | `React.ReactNode` | - | +| afterTitle | 标题后的提示图标或文案 | `React.ReactNode` | - | +| tooltip | 默认展示问号提示(优先级低于 `afterTitle`) | `React.ReactNode` | - | +| size | 小标题(small)、中标题(middle) | `small` | `middle` | `middle` | +| titleRowClassName | 标题一行的样式类名 | `string` | - | +| titleClassName | 标题的样式类名 | `string` | - | +| showBackground | 是否显示背景 | `boolean` | `true` | +| defaultExpand | 是否默认展开内容 | `boolean` | `true` | +| hasBottom | 是否有默认下边距 16px | `boolean` | `false` | +| spaceBottom | 自定义下边距,优先级高于 hasBottom | `number` | `0` | +| children | 展开/收起的内容 | `React.ReactNode` | - | +| onChange | 展开/收起时的回调 | `(expand: boolean) => void` | - |