mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
docs: format api card/carousel/collapse (#25364)
This commit is contained in:
parent
6cd8827072
commit
7f9fdded18
@ -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 |
|
| 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 | - | |
|
| activeTabKey | Current TabPane's key | string | - | |
|
||||||
| headStyle | Inline style to apply to the card head | CSSProperties | - | |
|
| headStyle | Inline style to apply to the card head | CSSProperties | - | |
|
||||||
| bodyStyle | Inline style to apply to the card content | CSSProperties | - | |
|
| bodyStyle | Inline style to apply to the card content | CSSProperties | - | |
|
||||||
| bordered | Toggles rendering of the border around the card | boolean | true | |
|
| bordered | Toggles rendering of the border around the card | boolean | true | |
|
||||||
| cover | Card cover | ReactNode | - | |
|
| cover | Card cover | ReactNode | - | |
|
||||||
| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set. | string | - | |
|
| 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 | - | |
|
| extra | Content to render in the top-right corner of the card | string \| ReactNode | - | |
|
||||||
| hoverable | Lift up when hovering card | boolean | false | |
|
| hoverable | Lift up when hovering card | boolean | false | |
|
||||||
| loading | Shows a loading indicator while the contents of the card are being fetched | 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}> | - | |
|
| tabList | List of TabPane's head | Array<{key: string, tab: ReactNode}> | - | |
|
||||||
| tabBarExtraContent | Extra content in tab bar | React.ReactNode | - | |
|
| tabBarExtraContent | Extra content in tab bar | ReactNode | - | |
|
||||||
| size | Size of card | `default` \| `small` | `default` | |
|
| 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 | - | |
|
| type | Card style type, can be set to `inner` or not set | string | - | |
|
||||||
| onTabChange | Callback when tab is switched | (key) => void | - | |
|
| onTabChange | Callback when tab is switched | (key) => void | - | |
|
||||||
| tabProps | [Tabs](/components/tabs/#Tabs) | - | - | |
|
| 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 |
|
| 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 | |
|
| hoverable | Lift up when hovering card grid | boolean | true | |
|
||||||
| style | style object of container | CSSProperties | - | |
|
| style | The style object of container | CSSProperties | - | |
|
||||||
|
|
||||||
### Card.Meta
|
### Card.Meta
|
||||||
|
|
||||||
| Property | Description | Type | Default | Version |
|
| Property | Description | Type | Default | Version |
|
||||||
| ----------- | ------------------------- | ------------- | ------- | ------- |
|
| ----------- | ----------------------------- | ------------- | ------- | ------- |
|
||||||
| avatar | avatar or icon | ReactNode | - | |
|
| avatar | Avatar or icon | ReactNode | - | |
|
||||||
| className | className of container | string | - | |
|
| className | The className of container | string | - | |
|
||||||
| description | description content | ReactNode | - | |
|
| description | Description content | ReactNode | - | |
|
||||||
| style | style object of container | CSSProperties | - | |
|
| style | The style object of container | CSSProperties | - | |
|
||||||
| title | title content | ReactNode | - | |
|
| title | Title content | ReactNode | - | |
|
||||||
|
@ -30,13 +30,13 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/NqXt8DJhky/Card.svg
|
|||||||
| bordered | 是否有边框 | boolean | true | |
|
| bordered | 是否有边框 | boolean | true | |
|
||||||
| cover | 卡片封面 | ReactNode | - | |
|
| cover | 卡片封面 | ReactNode | - | |
|
||||||
| defaultActiveTabKey | 初始化选中页签的 key,如果没有设置 activeTabKey | string | `第一个页签` | |
|
| defaultActiveTabKey | 初始化选中页签的 key,如果没有设置 activeTabKey | string | `第一个页签` | |
|
||||||
| extra | 卡片右上角的操作区域 | string\|ReactNode | - | |
|
| extra | 卡片右上角的操作区域 | string \| ReactNode | - | |
|
||||||
| hoverable | 鼠标移过时可浮起 | boolean | false | |
|
| hoverable | 鼠标移过时可浮起 | boolean | false | |
|
||||||
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false | |
|
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false | |
|
||||||
| tabList | 页签标题列表 | Array<{key: string, tab: ReactNode}> | - | |
|
| tabList | 页签标题列表 | Array<{key: string, tab: ReactNode}> | - | |
|
||||||
| tabBarExtraContent | tab bar 上额外的元素 | React.ReactNode | - | |
|
| tabBarExtraContent | tab bar 上额外的元素 | ReactNode | - | |
|
||||||
| size | card 的尺寸 | `default` \| `small` | `default` | |
|
| size | card 的尺寸 | `default` \| `small` | `default` | |
|
||||||
| title | 卡片标题 | string\|ReactNode | - | |
|
| title | 卡片标题 | string \| ReactNode | - | |
|
||||||
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - | |
|
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - | |
|
||||||
| onTabChange | 页签切换的回调 | (key) => void | - | |
|
| onTabChange | 页签切换的回调 | (key) => void | - | |
|
||||||
| tabProps | [Tabs](/components/tabs/#Tabs) | - | - | |
|
| tabProps | [Tabs](/components/tabs/#Tabs) | - | - | |
|
||||||
|
@ -20,8 +20,8 @@ A carousel component. Scales with its container.
|
|||||||
| afterChange | Callback function called after the current index changes | function(current) | - | |
|
| afterChange | Callback function called after the current index changes | function(current) | - | |
|
||||||
| autoplay | Whether to scroll automatically | boolean | false | |
|
| autoplay | Whether to scroll automatically | boolean | false | |
|
||||||
| beforeChange | Callback function called before the current index changes | function(from, to) | - | |
|
| 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 | |
|
| 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 | |
|
| 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` | |
|
| easing | Transition interpolation function name | string | `linear` | |
|
||||||
| effect | Transition effect | `scrollx` \| `fade` | `scrollx` | |
|
| effect | Transition effect | `scrollx` \| `fade` | `scrollx` | |
|
||||||
|
|
||||||
|
@ -21,10 +21,10 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/%24C9tmj978R/Carousel.svg
|
|||||||
| afterChange | 切换面板的回调 | function(current) | - | | |
|
| afterChange | 切换面板的回调 | function(current) | - | | |
|
||||||
| autoplay | 是否自动切换 | boolean | false | | |
|
| autoplay | 是否自动切换 | boolean | false | | |
|
||||||
| beforeChange | 切换面板的回调 | function(from, to) | - | | |
|
| beforeChange | 切换面板的回调 | function(from, to) | - | | |
|
||||||
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | bottom | |
|
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | `bottom` | |
|
||||||
| dots | 是否显示面板指示点,如果为 `object` 则同时可以指定 `dotsClass` 或者 | boolean \| { className?:string } | true | | |
|
| dots | 是否显示面板指示点,如果为 `object` 则同时可以指定 `dotsClass` 或者 | boolean \| { className?: string } | true | | |
|
||||||
| easing | 动画效果 | string | linear | | |
|
| easing | 动画效果 | string | `linear` | | |
|
||||||
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx | | |
|
| effect | 动画效果函数 | `scrollx` \| `fade` | `scrollx` | | |
|
||||||
|
|
||||||
## 方法
|
## 方法
|
||||||
|
|
||||||
|
@ -19,23 +19,23 @@ A content area which can be collapsed and expanded.
|
|||||||
|
|
||||||
| Property | Description | Type | Default | Version |
|
| 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. | |
|
| 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\| number\[]\|number | - | |
|
| defaultActiveKey | Key of the initial active panel | string\[] \| string <br/> number\[] \| number | - | |
|
||||||
| bordered | Toggles rendering of the border around the collapse block | boolean | true | |
|
| bordered | Toggles rendering of the border around the collapse block | boolean | true | |
|
||||||
| accordion | If `true`, `Collapse` renders as `Accordion` | boolean | false | |
|
| accordion | If true, Collapse renders as Accordion | boolean | false | |
|
||||||
| onChange | Callback function executed when active panel is changed | Function | - | |
|
| onChange | Callback function executed when active panel is changed | function | - | |
|
||||||
| expandIcon | allow to customize collapse icon | (panelProps) => ReactNode | - | |
|
| expandIcon | Allow to customize collapse icon | (panelProps) => ReactNode | - | |
|
||||||
| expandIconPosition | Set expand icon position | `left` \| `right` | - | |
|
| expandIconPosition | Set expand icon position | `left` \| `right` | - | |
|
||||||
| destroyInactivePanel | Destroy Inactive Panel | boolean | false | |
|
| 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
|
### Collapse.Panel
|
||||||
|
|
||||||
| Property | Description | Type | Default | Version |
|
| 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 | |
|
| forceRender | Forced render of content on panel, instead of lazy rending after clicking on header | boolean | false | |
|
||||||
| header | Title of the panel | string\|ReactNode | - | |
|
| header | Title of the panel | string \| ReactNode | - | |
|
||||||
| key | Unique key identifying the panel from among its siblings | string\|number | - | |
|
| key | Unique key identifying the panel from among its siblings | string \| number | - | |
|
||||||
| showArrow | If `false`, panel will not show arrow icon | boolean | true | |
|
| showArrow | If false, panel will not show arrow icon | boolean | true | |
|
||||||
| extra | extra element in the corner | ReactNode | - | |
|
| extra | The extra element in the corner | ReactNode | - | |
|
||||||
|
@ -20,11 +20,11 @@ cover: https://gw.alipayobjects.com/zos/alicdn/IxH16B9RD/Collapse.svg
|
|||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| activeKey | 当前激活 tab 面板的 key | string\[]\|string\| number\[]\|number | 默认无,accordion 模式下默认第一个元素 | |
|
| activeKey | 当前激活 tab 面板的 key | string\[] \| string <br/> number\[] \| number | 默认无,accordion 模式下默认第一个元素 | |
|
||||||
| defaultActiveKey | 初始化选中面板的 key | string\[]\|string\| number\[]\|number | - | |
|
| defaultActiveKey | 初始化选中面板的 key | string\[] \| string<br/> number\[] \| number | - | |
|
||||||
| bordered | 带边框风格的折叠面板 | boolean | true | |
|
| bordered | 带边框风格的折叠面板 | boolean | true | |
|
||||||
| accordion | 手风琴模式 | boolean | false | |
|
| accordion | 手风琴模式 | boolean | false | |
|
||||||
| onChange | 切换面板的回调 | Function | - | |
|
| onChange | 切换面板的回调 | function | - | |
|
||||||
| expandIcon | 自定义切换图标 | (panelProps) => ReactNode | - | |
|
| expandIcon | 自定义切换图标 | (panelProps) => ReactNode | - | |
|
||||||
| expandIconPosition | 设置图标位置 | `left` \| `right` | - | |
|
| expandIconPosition | 设置图标位置 | `left` \| `right` | - | |
|
||||||
| destroyInactivePanel | 销毁折叠隐藏的面板 | boolean | false | |
|
| destroyInactivePanel | 销毁折叠隐藏的面板 | boolean | false | |
|
||||||
@ -32,11 +32,11 @@ cover: https://gw.alipayobjects.com/zos/alicdn/IxH16B9RD/Collapse.svg
|
|||||||
|
|
||||||
### Collapse.Panel
|
### Collapse.Panel
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| ----------- | ------------------------------------------ | ----------------- | ------ | ---- |
|
| ----------- | ------------------------------------------ | ------------------- | ------ | ---- |
|
||||||
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false | |
|
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false | |
|
||||||
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | |
|
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | |
|
||||||
| header | 面板头内容 | string\|ReactNode | - | |
|
| header | 面板头内容 | string \| ReactNode | - | |
|
||||||
| key | 对应 activeKey | string\|number | - | |
|
| key | 对应 activeKey | string \| number | - | |
|
||||||
| showArrow | 是否展示当前面板上的箭头 | boolean | true | |
|
| showArrow | 是否展示当前面板上的箭头 | boolean | true | |
|
||||||
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - | |
|
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - | |
|
||||||
|
Loading…
Reference in New Issue
Block a user