docs: format api card/carousel/collapse (#25364)

This commit is contained in:
xrkffgg 2020-07-01 22:15:26 +08:00 committed by GitHub
parent 6cd8827072
commit 7f9fdded18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 46 deletions

View File

@ -22,20 +22,20 @@ A card can be used to display content related to a single subject. The content c
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| actions | The action list, shows at the bottom of the Card. | Array<ReactNode> | - | |
| actions | The action list, shows at the bottom of the Card | Array<ReactNode> | - | |
| activeTabKey | Current TabPane's key | string | - | |
| headStyle | Inline style to apply to the card head | CSSProperties | - | |
| bodyStyle | Inline style to apply to the card content | CSSProperties | - | |
| bordered | Toggles rendering of the border around the card | boolean | true | |
| cover | Card cover | ReactNode | - | |
| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set. | string | - | |
| extra | Content to render in the top-right corner of the card | string\|ReactNode | - | |
| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set | string | - | |
| extra | Content to render in the top-right corner of the card | string \| ReactNode | - | |
| hoverable | Lift up when hovering card | boolean | false | |
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false | |
| tabList | List of TabPane's head. | Array<{key: string, tab: ReactNode}> | - | |
| tabBarExtraContent | Extra content in tab bar | React.ReactNode | - | |
| tabList | List of TabPane's head | Array<{key: string, tab: ReactNode}> | - | |
| tabBarExtraContent | Extra content in tab bar | ReactNode | - | |
| size | Size of card | `default` \| `small` | `default` | |
| title | Card title | string\|ReactNode | - | |
| title | Card title | string \| ReactNode | - | |
| type | Card style type, can be set to `inner` or not set | string | - | |
| onTabChange | Callback when tab is switched | (key) => void | - | |
| tabProps | [Tabs](/components/tabs/#Tabs) | - | - | |
@ -44,16 +44,16 @@ A card can be used to display content related to a single subject. The content c
| Property | Description | Type | Default | Version |
| --------- | ------------------------------- | ------------- | ------- | ------- |
| className | className of container | string | - | |
| className | The className of container | string | - | |
| hoverable | Lift up when hovering card grid | boolean | true | |
| style | style object of container | CSSProperties | - | |
| style | The style object of container | CSSProperties | - | |
### Card.Meta
| Property | Description | Type | Default | Version |
| ----------- | ------------------------- | ------------- | ------- | ------- |
| avatar | avatar or icon | ReactNode | - | |
| className | className of container | string | - | |
| description | description content | ReactNode | - | |
| style | style object of container | CSSProperties | - | |
| title | title content | ReactNode | - | |
| Property | Description | Type | Default | Version |
| ----------- | ----------------------------- | ------------- | ------- | ------- |
| avatar | Avatar or icon | ReactNode | - | |
| className | The className of container | string | - | |
| description | Description content | ReactNode | - | |
| style | The style object of container | CSSProperties | - | |
| title | Title content | ReactNode | - | |

View File

@ -30,13 +30,13 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/NqXt8DJhky/Card.svg
| bordered | 是否有边框 | boolean | true | |
| cover | 卡片封面 | ReactNode | - | |
| defaultActiveTabKey | 初始化选中页签的 key如果没有设置 activeTabKey | string | `第一个页签` | |
| extra | 卡片右上角的操作区域 | string\|ReactNode | - | |
| extra | 卡片右上角的操作区域 | string \| ReactNode | - | |
| hoverable | 鼠标移过时可浮起 | boolean | false | |
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false | |
| tabList | 页签标题列表 | Array<{key: string, tab: ReactNode}> | - | |
| tabBarExtraContent | tab bar 上额外的元素 | React.ReactNode | - | |
| tabBarExtraContent | tab bar 上额外的元素 | ReactNode | - | |
| size | card 的尺寸 | `default` \| `small` | `default` | |
| title | 卡片标题 | string\|ReactNode | - | |
| title | 卡片标题 | string \| ReactNode | - | |
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - | |
| onTabChange | 页签切换的回调 | (key) => void | - | |
| tabProps | [Tabs](/components/tabs/#Tabs) | - | - | |

View File

@ -20,8 +20,8 @@ A carousel component. Scales with its container.
| afterChange | Callback function called after the current index changes | function(current) | - | |
| autoplay | Whether to scroll automatically | boolean | false | |
| beforeChange | Callback function called before the current index changes | function(from, to) | - | |
| dotPosition | The position of the dots, which can be one of `top` `bottom` `left` `right` | string | bottom | |
| dots | Whether to show the dots at the bottom of the gallery, `object` for `dotsClass` and any others | boolean \| { className?:string } | true | |
| dotPosition | The position of the dots, which can be one of `top` `bottom` `left` `right` | string | `bottom` | |
| dots | Whether to show the dots at the bottom of the gallery, `object` for `dotsClass` and any others | boolean \| { className?: string } | true | |
| easing | Transition interpolation function name | string | `linear` | |
| effect | Transition effect | `scrollx` \| `fade` | `scrollx` | |

View File

@ -21,10 +21,10 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/%24C9tmj978R/Carousel.svg
| afterChange | 切换面板的回调 | function(current) | - | | |
| autoplay | 是否自动切换 | boolean | false | | |
| beforeChange | 切换面板的回调 | function(from, to) | - | | |
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | bottom | |
| dots | 是否显示面板指示点,如果为 `object` 则同时可以指定 `dotsClass` 或者 | boolean \| { className?:string } | true | | |
| easing | 动画效果 | string | linear | | |
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx | | |
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | `bottom` | |
| dots | 是否显示面板指示点,如果为 `object` 则同时可以指定 `dotsClass` 或者 | boolean \| { className?: string } | true | | |
| easing | 动画效果 | string | `linear` | | |
| effect | 动画效果函数 | `scrollx` \| `fade` | `scrollx` | | |
## 方法

View File

@ -19,23 +19,23 @@ A content area which can be collapsed and expanded.
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| 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 | - | |
| activeKey | Key of the active panel | string\[] \| string <br/> 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 <br/> number\[] \| number | - | |
| bordered | Toggles rendering of the border around the collapse block | boolean | true | |
| accordion | If `true`, `Collapse` renders as `Accordion` | boolean | false | |
| onChange | Callback function executed when active panel is changed | Function | - | |
| expandIcon | allow to customize collapse icon | (panelProps) => ReactNode | - | |
| accordion | If true, Collapse renders as Accordion | boolean | false | |
| onChange | Callback function executed when active panel is changed | function | - | |
| expandIcon | Allow to customize collapse icon | (panelProps) => ReactNode | - | |
| expandIconPosition | Set expand icon position | `left` \| `right` | - | |
| destroyInactivePanel | Destroy Inactive Panel | boolean | false | |
| ghost | make the collapse borderless and its background transparent | boolean | false | 4.4.0 |
| ghost | Make the collapse borderless and its background transparent | boolean | false | 4.4.0 |
### Collapse.Panel
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| disabled | If `true`, panel cannot be opened or closed | boolean | false | |
| 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 | |
| header | Title of the panel | string\|ReactNode | - | |
| key | Unique key identifying the panel from among its siblings | string\|number | - | |
| showArrow | If `false`, panel will not show arrow icon | boolean | true | |
| extra | extra element in the corner | ReactNode | - | |
| header | Title of the panel | string \| ReactNode | - | |
| key | Unique key identifying the panel from among its siblings | string \| number | - | |
| showArrow | If false, panel will not show arrow icon | boolean | true | |
| extra | The extra element in the corner | ReactNode | - | |

View File

@ -20,11 +20,11 @@ cover: https://gw.alipayobjects.com/zos/alicdn/IxH16B9RD/Collapse.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| activeKey | 当前激活 tab 面板的 key | string\[]\|string\| number\[]\|number | 默认无accordion 模式下默认第一个元素 | |
| defaultActiveKey | 初始化选中面板的 key | string\[]\|string\| number\[]\|number | - | |
| activeKey | 当前激活 tab 面板的 key | string\[] \| string <br/> number\[] \| number | 默认无accordion 模式下默认第一个元素 | |
| defaultActiveKey | 初始化选中面板的 key | string\[] \| string<br/> number\[] \| number | - | |
| bordered | 带边框风格的折叠面板 | boolean | true | |
| accordion | 手风琴模式 | boolean | false | |
| onChange | 切换面板的回调 | Function | - | |
| onChange | 切换面板的回调 | function | - | |
| expandIcon | 自定义切换图标 | (panelProps) => ReactNode | - | |
| expandIconPosition | 设置图标位置 | `left` \| `right` | - | |
| destroyInactivePanel | 销毁折叠隐藏的面板 | boolean | false | |
@ -32,11 +32,11 @@ cover: https://gw.alipayobjects.com/zos/alicdn/IxH16B9RD/Collapse.svg
### Collapse.Panel
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ----------- | ------------------------------------------ | ----------------- | ------ | ---- |
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false | |
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | |
| header | 面板头内容 | string\|ReactNode | - | |
| key | 对应 activeKey | string\|number | - | |
| showArrow | 是否展示当前面板上的箭头 | boolean | true | |
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ----------- | ------------------------------------------ | ------------------- | ------ | ---- |
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false | |
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | |
| header | 面板头内容 | string \| ReactNode | - | |
| key | 对应 activeKey | string \| number | - | |
| showArrow | 是否展示当前面板上的箭头 | boolean | true | |
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - | |