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,
  7. graphical web browser developed by the
  8. Mozilla Corporation and hundreds of
  9. volunteers.
  10. </Description>
  11. <Description term="Firefox">
  12. A free, open source, cross-platform,
  13. graphical web browser developed by the
  14. Mozilla Corporation and hundreds of
  15. volunteers.
  16. </Description>
  17. <Description term="Firefox">
  18. A free, open source, cross-platform,
  19. graphical web browser developed by the
  20. Mozilla Corporation and hundreds of
  21. volunteers.
  22. </Description>
  23. </DescriptionList>
  24. , mountNode);

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,
  7. graphical web browser developed by the
  8. Mozilla Corporation and hundreds of
  9. volunteers.
  10. </Description>
  11. <Description term="Firefox">
  12. A free, open source, cross-platform,
  13. graphical web browser developed by the
  14. Mozilla Corporation and hundreds of
  15. volunteers.
  16. </Description>
  17. <Description term="Firefox">
  18. A free, open source, cross-platform,
  19. graphical web browser developed by the
  20. Mozilla Corporation and hundreds of
  21. volunteers.
  22. </Description>
  23. </DescriptionList>
  24. , mountNode);

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-