perf: layout add default value (#50797)

This commit is contained in:
Wanpan 2024-09-11 00:03:02 +08:00 committed by GitHub
parent 01d1b3d492
commit ef1b0e32ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View File

@ -22,7 +22,7 @@ const Splitter: React.FC<React.PropsWithChildren<SplitterProps>> = (props) => {
prefixCls: customizePrefixCls, prefixCls: customizePrefixCls,
className, className,
style, style,
layout, layout = 'horizontal',
children, children,
rootClassName, rootClassName,
onResizeStart, onResizeStart,
@ -117,9 +117,8 @@ const Splitter: React.FC<React.PropsWithChildren<SplitterProps>> = (props) => {
const containerClassName = classNames( const containerClassName = classNames(
prefixCls, prefixCls,
className, className,
`${prefixCls}-${layout}`,
{ {
[`${prefixCls}-horizontal`]: !isVertical,
[`${prefixCls}-vertical`]: isVertical,
[`${prefixCls}-rtl`]: isRTL, [`${prefixCls}-rtl`]: isRTL,
}, },
rootClassName, rootClassName,

View File

@ -44,6 +44,7 @@ Common props ref[Common props](/docs/react/common-props)
| Property | Description | Type | Default | Version | | Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| defaultSize | Initial panel size support number for px or 'percent%' usage | `number \| string` | - | - |
| min | Minimum threshold support number for px or 'percent%' usage | `number \| string` | - | - | | min | Minimum threshold support number for px or 'percent%' usage | `number \| string` | - | - |
| max | Maximum threshold support number for px or 'percent%' usage | `number \| string` | - | - | | max | Maximum threshold support number for px or 'percent%' usage | `number \| string` | - | - |
| size | Controlled panel size support number for px or 'percent%' usage | `number \| string` | - | - | | size | Controlled panel size support number for px or 'percent%' usage | `number \| string` | - | - |

View File

@ -45,6 +45,7 @@ tag: 5.21.0
| 参数 | 说明 | 类型 | 默认值 | 版本 | | 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| defaultSize | 初始面板大小,支持数字 px 或者文字 '百分比%' 类型 | `number \| string` | - | - |
| min | 最小阈值,支持数字 px 或者文字 '百分比%' 类型 | `number \| string` | - | - | | min | 最小阈值,支持数字 px 或者文字 '百分比%' 类型 | `number \| string` | - | - |
| max | 最大阈值,支持数字 px 或者文字 '百分比%' 类型 | `number \| string` | - | - | | max | 最大阈值,支持数字 px 或者文字 '百分比%' 类型 | `number \| string` | - | - |
| size | 受控面板大小,支持数字 px 或者文字 '百分比%' 类型 | `number \| string` | - | - | | size | 受控面板大小,支持数字 px 或者文字 '百分比%' 类型 | `number \| string` | - | - |