mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-24 15:38:45 +08:00
parent
6e78ffd0a6
commit
58089c7832
@ -376,7 +376,7 @@ exports[`renders ./components/list/demo/loadmore.md correctly 1`] = `
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
style="text-align:center;margin-top:8px"
|
||||
style="text-align:center;margin-top:8px;height:32px"
|
||||
>
|
||||
<button
|
||||
class="ant-btn"
|
||||
@ -401,7 +401,7 @@ exports[`renders ./components/list/demo/resposive.md correctly 1`] = `
|
||||
style="margin-left:-8px;margin-right:-8px"
|
||||
>
|
||||
<div
|
||||
class="ant-col-xs-12 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
class="ant-col-xs-24 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
>
|
||||
<div
|
||||
class="ant-list-item"
|
||||
@ -440,7 +440,7 @@ exports[`renders ./components/list/demo/resposive.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-xs-12 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
class="ant-col-xs-24 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
>
|
||||
<div
|
||||
class="ant-list-item"
|
||||
@ -479,7 +479,7 @@ exports[`renders ./components/list/demo/resposive.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-xs-12 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
class="ant-col-xs-24 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
>
|
||||
<div
|
||||
class="ant-list-item"
|
||||
@ -518,7 +518,7 @@ exports[`renders ./components/list/demo/resposive.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-xs-12 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
class="ant-col-xs-24 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
>
|
||||
<div
|
||||
class="ant-list-item"
|
||||
@ -556,6 +556,84 @@ exports[`renders ./components/list/demo/resposive.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-xs-24 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
>
|
||||
<div
|
||||
class="ant-list-item"
|
||||
style="padding-left:8px;padding-right:8px"
|
||||
>
|
||||
<div
|
||||
class="ant-list-item-content ant-list-item-content-single"
|
||||
>
|
||||
<div
|
||||
class="ant-card ant-card-bordered"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
<div
|
||||
class="ant-card-head-wrapper"
|
||||
>
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Title 5
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
>
|
||||
<div>
|
||||
Card content
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-xs-24 ant-col-sm-12 ant-col-md-6 ant-col-lg-6 ant-col-xl-4"
|
||||
>
|
||||
<div
|
||||
class="ant-list-item"
|
||||
style="padding-left:8px;padding-right:8px"
|
||||
>
|
||||
<div
|
||||
class="ant-list-item-content ant-list-item-content-single"
|
||||
>
|
||||
<div
|
||||
class="ant-card ant-card-bordered"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
<div
|
||||
class="ant-card-head-wrapper"
|
||||
>
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Title 6
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
>
|
||||
<div>
|
||||
Card content
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2,7 +2,7 @@
|
||||
order: 1
|
||||
title:
|
||||
zh-CN: 基础列表
|
||||
en-US: Basic List
|
||||
en-US: Basic list
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
@ -11,7 +11,7 @@ title:
|
||||
|
||||
## en-US
|
||||
|
||||
Basic List.
|
||||
Basic list.
|
||||
|
||||
````jsx
|
||||
import { List, Avatar } from 'antd';
|
||||
|
@ -7,11 +7,11 @@ title:
|
||||
|
||||
## zh-CN
|
||||
|
||||
栅格列表。
|
||||
可以通过设置 `List` 的 `grid` 属性来实现栅格列表,`column` 可设置期望显示的列数。
|
||||
|
||||
## en-US
|
||||
|
||||
Grid List.
|
||||
Creating a grid list by setting the `grid` property of List
|
||||
|
||||
````jsx
|
||||
import { List, Card } from 'antd';
|
||||
|
@ -2,7 +2,7 @@
|
||||
order: 6
|
||||
title:
|
||||
zh-CN: 滚动加载
|
||||
en-US: Scrolling loaded List
|
||||
en-US: Scrolling loaded
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
@ -2,7 +2,7 @@
|
||||
order: 7
|
||||
title:
|
||||
zh-CN: 滚动加载无限长列表
|
||||
en-US: Infinite virtualized List
|
||||
en-US: Infinite & virtualized
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
@ -13,7 +13,7 @@ title:
|
||||
|
||||
## en-US
|
||||
|
||||
The example of infinite & virtualized load with [react-virtualized](https://github.com/bvaughn/react-virtualized). [learn more](https://blog.jscrambler.com/optimizing-react-rendering-through-virtualization/)
|
||||
The example of infinite & virtualized load with [react-virtualized](https://github.com/bvaughn/react-virtualized). [Learned more](https://blog.jscrambler.com/optimizing-react-rendering-through-virtualization/)
|
||||
|
||||
`virtualized` is a technology which use to mount big data, to reducing the render dom witch not visible.
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
order: 2
|
||||
title:
|
||||
zh-CN: 加载更多
|
||||
en-US: loadmore
|
||||
en-US: Load more
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
@ -11,7 +11,7 @@ title:
|
||||
|
||||
## en-US
|
||||
|
||||
To show how to realize a loading more list with `loadMore` prop.
|
||||
Load more list with `loadMore` property.
|
||||
|
||||
````jsx
|
||||
import { List, Avatar, Button, Spin } from 'antd';
|
||||
@ -57,6 +57,8 @@ class LoadMoreList extends React.Component {
|
||||
loadingMore: false,
|
||||
}, () => {
|
||||
// Resetting window's offsetTop so as to display react-virtualized demo underfloor.
|
||||
// In real scene, you can using public method of react-virtualized:
|
||||
// https://stackoverflow.com/questions/46700726/how-to-use-public-method-updateposition-of-react-virtualized
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
});
|
||||
});
|
||||
@ -64,7 +66,7 @@ class LoadMoreList extends React.Component {
|
||||
render() {
|
||||
const { loading, loadingMore, showLoadingMore, data } = this.state;
|
||||
const loadMore = showLoadingMore ? (
|
||||
<div style={{ textAlign: 'center', marginTop: 8 }}>
|
||||
<div style={{ textAlign: 'center', marginTop: 8, height: 32 }}>
|
||||
{loadingMore && <Spin />}
|
||||
{!loadingMore && <Button onClick={this.onLoadMore}>loading more</Button>}
|
||||
</div>
|
||||
|
@ -2,16 +2,16 @@
|
||||
order: 5
|
||||
title:
|
||||
zh-CN: 响应式的栅格列表
|
||||
en-US: Grid
|
||||
en-US: Responsive grid list
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
响应式的栅格列表。
|
||||
响应式的栅格列表。尺寸与 [Layout Grid](https://ant.design/components/grid-cn/#Col) 保持一致。
|
||||
|
||||
## en-US
|
||||
|
||||
Responsive Grid List.
|
||||
Responsive grid list. The size property is as same as [Layout Grid](https://ant.design/components/grid/#Col).
|
||||
|
||||
````jsx
|
||||
import { List, Card } from 'antd';
|
||||
@ -29,11 +29,17 @@ const data = [
|
||||
{
|
||||
title: 'Title 4',
|
||||
},
|
||||
{
|
||||
title: 'Title 5',
|
||||
},
|
||||
{
|
||||
title: 'Title 6',
|
||||
},
|
||||
];
|
||||
|
||||
ReactDOM.render(
|
||||
<List
|
||||
grid={{ gutter: 16, xs: 2, sm: 2, md: 4, lg: 4, xl: 6 }}
|
||||
grid={{ gutter: 16, xs: 1, sm: 2, md: 4, lg: 4, xl: 6 }}
|
||||
dataSource={data}
|
||||
renderItem={item => (
|
||||
<List.Item>
|
||||
|
@ -2,7 +2,7 @@
|
||||
order: 0
|
||||
title:
|
||||
zh-CN: 简单列表
|
||||
en-US: Simple
|
||||
en-US: Simple list
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
@ -15,7 +15,11 @@ title:
|
||||
|
||||
## en-US
|
||||
|
||||
Simple List.
|
||||
Ant Design supports a default list size as well as a large and small size.
|
||||
|
||||
If a large or small list is desired, set the size property to either large or small respectively. Omit the size property for a list with the default size.
|
||||
|
||||
Customizing the header and footer of list by setting `header` and `footer` property.
|
||||
|
||||
````jsx
|
||||
import { List } from 'antd';
|
||||
|
@ -2,16 +2,16 @@
|
||||
order: 3
|
||||
title:
|
||||
zh-CN: 竖排列表样式
|
||||
en-US: Layout Vertical
|
||||
en-US: Vertical
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
基础列表。
|
||||
通过设置 `itemLayout` 属性为 `vertical` 可实现竖排列表样式。
|
||||
|
||||
## en-US
|
||||
|
||||
Basic List.
|
||||
Setting `itemLayout` property with `vertical` to create a vertical list.
|
||||
|
||||
````jsx
|
||||
import { List, Avatar, Icon } from 'antd';
|
||||
|
@ -17,38 +17,39 @@ A list can be used to display content related to a single subject. The content c
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|----------------|----------|--------------|
|
||||
| bordered | - | string \| boolean | false |
|
||||
| split | - | string \| boolean | true |
|
||||
| loading | -| boolean | false |
|
||||
| itemLayout | - | string | - |
|
||||
| loadMore | -| string\|ReactNode | - |
|
||||
| pagination | - | boolean \| object | false |
|
||||
| grid | - | object | - |
|
||||
| header | - | string\|ReactNode | - |
|
||||
| footer | - | string\|ReactNode | - |
|
||||
| bordered | Toggles rendering of the border around the list | boolean | false |
|
||||
| split | Toggles rendering of the split under the list item | boolean | true |
|
||||
| loading | Shows a loading indicator while the contents of the list are being fetched | boolean | false |
|
||||
| itemLayout | The layout of list, default is `horizontal`, If a vertical list is desired, set the itemLayout property to `vertical` | string | - |
|
||||
| loadMore | Shows a load more content | string\|ReactNode | - |
|
||||
| pagination | Pagination [config](https://ant.design/components/pagination/), hide it by setting it to false | boolean \| object | false |
|
||||
| grid | The grid type of list. You can set grid to something like {gutter: 16, column: 4} | object | - |
|
||||
| header | List header renderer | string\|ReactNode | - |
|
||||
| footer | List footer renderer | string\|ReactNode | - |
|
||||
|
||||
### List grid props
|
||||
| Property | Description | Type | Default |
|
||||
---------|-------------|------|---------
|
||||
| gutter | - | number | 0 |
|
||||
| column | - | number | - |
|
||||
| xs | `<768px` - | number | - |
|
||||
| sm | `≥768px` - | number | - |
|
||||
| md | `≥992px` - | number | - |
|
||||
| lg | `≥1200px` - | number | - |
|
||||
| xl | `≥1600px` - | number | - |
|
||||
| gutter | spacing between grid | number | 0 |
|
||||
| column | column of grid | number | - |
|
||||
| xs | `<576px` column of grid | number | - |
|
||||
| sm | `≥576px` column of grid | number | - |
|
||||
| md | `≥768px` column of grid | number | - |
|
||||
| lg | `≥992px` column of grid | number | - |
|
||||
| xl | `≥1200px` column of grid | number | - |
|
||||
| xxl | `≥1600px` column of grid | number | - |
|
||||
|
||||
### List.Item
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
---------|-------------|------|---------
|
||||
| extra | - | string\|ReactNode | - |
|
||||
| actions | - | Array<ReactNode> | - |
|
||||
| extra | The extra content of list item. If `itemLayout` is `vertical`, shows the content on right, otherwise shows content on the far right. | string\|ReactNode | - |
|
||||
| actions | The actions content of list item. If `itemLayout` is `vertical`, shows the content on bottom, otherwise shows content on the far right. | Array<ReactNode> | - |
|
||||
|
||||
### List.Item.Meta
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
---------|-------------|------|---------
|
||||
| avatar | - | ReactNode | - |
|
||||
| title | - | string\|ReactNode | - |
|
||||
| description | - | string\|ReactNode | - |
|
||||
| avatar | The avatar of list item | ReactNode | - |
|
||||
| title | The title of list item | string\|ReactNode | - |
|
||||
| description | The description of list item | string\|ReactNode | - |
|
||||
|
@ -20,11 +20,11 @@ cols: 1
|
||||
|----------|----------------|----------|--------------|
|
||||
| bordered | 是否展示边框 | boolean | false |
|
||||
| split | 是否展示分割线 | boolean | true |
|
||||
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
|
||||
| itemLayout | 设置 List.Item 布局, 设置成 vertical 则竖直样式显示, 默认横排 | string | - |
|
||||
| loading | 当卡片内容还在加载中时,可以用 `loading` 展示一个占位 | boolean | false |
|
||||
| itemLayout | 设置 `List.Item` 布局, 设置成 `vertical` 则竖直样式显示, 默认横排 | string | - |
|
||||
| loadMore | 加载更多 | string\|ReactNode | - |
|
||||
| pagination | 对应的 pagination 配置, 设置 false 不显示 | boolean \| object | false |
|
||||
| grid | 列表栅格 | object | - |
|
||||
| pagination | 对应的 `pagination` 配置, 设置 `false` 不显示 | boolean\|object | false |
|
||||
| grid | 列表栅格配置 | object | - |
|
||||
| header | 列表头部 | string\|ReactNode | - |
|
||||
| footer | 列表底部 | string\|ReactNode | - |
|
||||
|
||||
@ -33,18 +33,19 @@ cols: 1
|
||||
---------|-------------|------|---------
|
||||
| gutter | 栅格间隔 | number | 0 |
|
||||
| column | 列数 | number | - |
|
||||
| xs | `<768px` 展示的列数 | number | - |
|
||||
| sm | `≥768px` 展示的列数 | number | - |
|
||||
| md | `≥992px` 展示的列数 | number | - |
|
||||
| lg | `≥1200px` 展示的列数 | number | - |
|
||||
| xl | `≥1600px` 展示的列数 | number | - |
|
||||
| xs | `<576px` 展示的列数 | number | - |
|
||||
| sm | `≥576px` 展示的列数 | number | - |
|
||||
| md | `≥768px` 展示的列数 | number | - |
|
||||
| lg | `≥992px` 展示的列数 | number | - |
|
||||
| xl | `≥1200px` 展示的列数 | number | - |
|
||||
| xxl | `≥1600px` 展示的列数 | number | - |
|
||||
|
||||
### List.Item
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
---------|-------------|------|---------
|
||||
| extra | 额外内容, 通常用在 itemLayout 为 vertical 的情况下, 展示右侧内容; horizontal 展示在列表元素最右侧 | string\|ReactNode | - |
|
||||
| actions | 列表操作组,根据 itemLayout 的不同, 位置在卡片底部或者最右侧 | Array<ReactNode> | - |
|
||||
| extra | 额外内容, 通常用在 `itemLayout` 为 `vertical` 的情况下, 展示右侧内容; `horizontal` 展示在列表元素最右侧 | string\|ReactNode | - |
|
||||
| actions | 列表操作组,根据 `itemLayout` 的不同, 位置在卡片底部或者最右侧 | Array<ReactNode\> | - |
|
||||
|
||||
### List.Item.Meta
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user