DescriptionList描述列表

成组展示多个只读字段,常见于详情页的信息展示。

引用方式:

  1. import DescriptionList from 'ant-design-pro/lib/DescriptionList';

详细使用方式请参照:独立使用 pro 组件

代码演示

DescriptionList 描述列表 - 图1

基本

基本描述列表。

  1. import DescriptionList from 'ant-design-pro/lib/DescriptionList';
  2. const { Description } = DescriptionList;
  3. ReactDOM.render(
  4. <DescriptionList size="large" title="title">
  5. <Description term="Firefox">
  6. A free, open source, cross-platform, graphical web browser developed by the Mozilla
  7. Corporation and hundreds of volunteers.
  8. </Description>
  9. <Description term="Firefox">
  10. A free, open source, cross-platform, graphical web browser developed by the Mozilla
  11. Corporation and hundreds of volunteers.
  12. </Description>
  13. <Description term="Firefox">
  14. A free, open source, cross-platform, graphical web browser developed by the Mozilla
  15. Corporation and hundreds of volunteers.
  16. </Description>
  17. </DescriptionList>,
  18. mountNode
  19. );

DescriptionList 描述列表 - 图2

垂直型

垂直布局。

  1. import DescriptionList from 'ant-design-pro/lib/DescriptionList';
  2. const { Description } = DescriptionList;
  3. ReactDOM.render(
  4. <DescriptionList size="large" title="title" layout="vertical">
  5. <Description term="Firefox">
  6. A free, open source, cross-platform, graphical web browser developed by the Mozilla
  7. Corporation and hundreds of volunteers.
  8. </Description>
  9. <Description term="Firefox">
  10. A free, open source, cross-platform, graphical web browser developed by the Mozilla
  11. Corporation and hundreds of volunteers.
  12. </Description>
  13. <Description term="Firefox">
  14. A free, open source, cross-platform, graphical web browser developed by the Mozilla
  15. Corporation and hundreds of volunteers.
  16. </Description>
  17. </DescriptionList>,
  18. mountNode
  19. );

API

DescriptionList

参数说明类型默认值
layout布局方式Enum{'horizontal', 'vertical'}'horizontal'
col指定信息最多分几列展示,最终一行几列由 col 配置结合响应式规则决定number(0 < col <= 4)3
title列表标题ReactNode-
gutter列表项间距,单位为 pxnumber32
size列表型号Enum{'large', 'small'}-

响应式规则

窗口宽度展示列数
≥768pxcol
≥576pxcol < 2 ? col : 2
<576px1

DescriptionList.Description

参数说明类型默认值
term列表项标题ReactNode-