diff --git a/components/descriptions/Cell.tsx b/components/descriptions/Cell.tsx index 53cd71fa72..928f43aeaa 100644 --- a/components/descriptions/Cell.tsx +++ b/components/descriptions/Cell.tsx @@ -47,7 +47,8 @@ const Cell: React.FC = ({ style={style} colSpan={span} > - {notEmpty(label) ? label : content} + {notEmpty(label) && {label}} + {notEmpty(content) && {content}} ); } diff --git a/components/descriptions/__tests__/__snapshots__/demo.test.js.snap b/components/descriptions/__tests__/__snapshots__/demo.test.js.snap index 1545113e7a..9eeac44342 100644 --- a/components/descriptions/__tests__/__snapshots__/demo.test.js.snap +++ b/components/descriptions/__tests__/__snapshots__/demo.test.js.snap @@ -152,37 +152,49 @@ exports[`renders ./components/descriptions/demo/border.md correctly 1`] = ` class="ant-descriptions-item-label" colspan="1" > - Product + + Product + - Cloud Database + + Cloud Database + - Billing Mode + + Billing Mode + - Prepaid + + Prepaid + - Automatic Renewal + + Automatic Renewal + - YES + + YES + - Order time + + Order time + - 2018-04-24 18:00:00 + + 2018-04-24 18:00:00 + - Usage Time + + Usage Time + - 2019-04-24 18:00:00 + + 2019-04-24 18:00:00 + - Status + + Status + - + - - Running + + + Running + @@ -247,37 +271,49 @@ exports[`renders ./components/descriptions/demo/border.md correctly 1`] = ` class="ant-descriptions-item-label" colspan="1" > - Negotiated Amount + + Negotiated Amount + - $80.00 + + $80.00 + - Discount + + Discount + - $20.00 + + $20.00 + - Official Receipts + + Official Receipts + - $60.00 + + $60.00 + - Config Info + + Config Info + - Data disk type: MongoDB -
- Database version: 3.4 -
- Package: dds.mongo.mid -
- Storage space: 10 GB -
- Replication factor: 3 -
- Region: East China 1 -
+ + Data disk type: MongoDB +
+ Database version: 3.4 +
+ Package: dds.mongo.mid +
+ Storage space: 10 GB +
+ Replication factor: 3 +
+ Region: East China 1 +
+
@@ -339,37 +379,49 @@ exports[`renders ./components/descriptions/demo/responsive.md correctly 1`] = ` class="ant-descriptions-item-label" colspan="1" > - Product + + Product + - Cloud Database + + Cloud Database + - Billing + + Billing + - Prepaid + + Prepaid + - time + + time + - 18:00:00 + + 18:00:00 + - Amount + + Amount + - $80.00 + + $80.00 + - Discount + + Discount + - $20.00 + + $20.00 + - Official + + Official + - $60.00 + + $60.00 + - Config Info + + Config Info + - Data disk type: MongoDB -
- Database version: 3.4 -
- Package: dds.mongo.mid -
- Storage space: 10 GB -
- Replication factor: 3 -
- Region: East China 1 + + Data disk type: MongoDB +
+ Database version: 3.4 +
+ Package: dds.mongo.mid +
+ Storage space: 10 GB +
+ Replication factor: 3 +
+ Region: East China 1 +
@@ -547,37 +615,49 @@ exports[`renders ./components/descriptions/demo/size.md correctly 1`] = ` class="ant-descriptions-item-label" colspan="1" > - Product + + Product + - Cloud Database + + Cloud Database + - Billing + + Billing + - Prepaid + + Prepaid + - time + + time + - 18:00:00 + + 18:00:00 + - Amount + + Amount + - $80.00 + + $80.00 + - Discount + + Discount + - $20.00 + + $20.00 + - Official + + Official + - $60.00 + + $60.00 + - Config Info + + Config Info + - Data disk type: MongoDB -
- Database version: 3.4 -
- Package: dds.mongo.mid -
- Storage space: 10 GB -
- Replication factor: 3 -
- Region: East China 1 -
+ + Data disk type: MongoDB +
+ Database version: 3.4 +
+ Package: dds.mongo.mid +
+ Storage space: 10 GB +
+ Replication factor: 3 +
+ Region: East China 1 +
+
@@ -813,90 +909,72 @@ exports[`renders ./components/descriptions/demo/size.md correctly 1`] = ` exports[`renders ./components/descriptions/demo/style.md correctly 1`] = ` Array [ -
+ -
+ , + -
+ + + + horizontal + + +
+ + + + + + vertical + +
, +