Skip to content

Commit

Permalink
Fix Collapse Panel key type. (#17557)
Browse files Browse the repository at this point in the history
  • Loading branch information
thylsky authored and dengfuping committed Jul 13, 2019
1 parent 8798198 commit 6c9b177
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions components/collapse/Collapse.tsx
Expand Up @@ -9,8 +9,8 @@ import animation from '../_util/openAnimation';
export type ExpandIconPosition = 'left' | 'right';

export interface CollapseProps {
activeKey?: Array<string> | string;
defaultActiveKey?: Array<string>;
activeKey?: Array<string | number> | string | number;
defaultActiveKey?: Array<string | number> | string | number;
/** 手风琴效果 */
accordion?: boolean;
destroyInactivePanel?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion components/collapse/CollapsePanel.tsx
Expand Up @@ -4,7 +4,7 @@ import classNames from 'classnames';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';

export interface CollapsePanelProps {
key: string;
key: string | number;
header: React.ReactNode;
disabled?: boolean;
className?: string;
Expand Down
6 changes: 3 additions & 3 deletions components/collapse/index.en-US.md
Expand Up @@ -18,8 +18,8 @@ A content area which can be collapsed and expanded.

| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| activeKey | Key of the active panel | string\[]\|string | No default value. In `accordion` mode, it's the key of the first panel. | |
| defaultActiveKey | Key of the initial active panel | string | - | |
| activeKey | Key of the active panel | string\[]\|string\| number\[]\|number | No default value. In `accordion` mode, it's the key of the first panel. | |
| defaultActiveKey | Key of the initial active panel | string\[]\|string\| number\[]\|number | - | |
| bordered | Toggles rendering of the border around the collapse block | boolean | `true` | 3.6.5 |
| accordion | If `true`, `Collapse` renders as `Accordion` | boolean | `false` | 3.6.5 |
| onChange | Callback function executed when active panel is changed | Function | - | |
Expand All @@ -34,6 +34,6 @@ A content area which can be collapsed and expanded.
| disabled | If `true`, panel cannot be opened or closed | boolean | `false` | |
| forceRender | Forced render of content on panel, instead of lazy rending after clicking on header | boolean | `false` | 3.2.0 |
| header | Title of the panel | string\|ReactNode | - | |
| key | Unique key identifying the panel from among its siblings | string | - | |
| key | Unique key identifying the panel from among its siblings | string\|number | - | |
| showArrow | If `false`, panel will not show arrow icon | boolean | `true` | 3.1.0 |
| extra | extra element in the corner | ReactNode | - | 3.14.0 |
6 changes: 3 additions & 3 deletions components/collapse/index.zh-CN.md
Expand Up @@ -19,8 +19,8 @@ cols: 1

| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| activeKey | 当前激活 tab 面板的 key | string\[]\|string | 默认无,accordion 模式下默认第一个元素 | |
| defaultActiveKey | 初始化选中面板的 key | string || |
| activeKey | 当前激活 tab 面板的 key | string\[]\|string\| number\[]\|number | 默认无,accordion 模式下默认第一个元素 | |
| defaultActiveKey | 初始化选中面板的 key | string\[]\|string\| number\[]\|number || |
| bordered | 带边框风格的折叠面板 | boolean | `true` | 3.13.0 |
| accordion | 手风琴模式 | boolean | `false` | 3.13.0 |
| onChange | 切换面板的回调 | Function || |
Expand All @@ -35,6 +35,6 @@ cols: 1
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false | |
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | 3.2.0 |
| header | 面板头内容 | string\|ReactNode || |
| key | 对应 activeKey | string || |
| key | 对应 activeKey | string\|number || |
| showArrow | 是否展示当前面板上的箭头 | boolean | `true` | 3.13.0 |
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - | 3.14.0 |

0 comments on commit 6c9b177

Please sign in to comment.