diff --git a/components/descriptions/__tests__/index.test.js b/components/descriptions/__tests__/index.test.js index 53eff9e359..2c7b1fa1f4 100644 --- a/components/descriptions/__tests__/index.test.js +++ b/components/descriptions/__tests__/index.test.js @@ -42,9 +42,11 @@ describe('Descriptions', () => { Prepaid 18:00:00 $80.00 + No-Label , ); - expect(wrapper.find('tr')).toHaveLength(4); + expect(wrapper.find('tr')).toHaveLength(5); + expect(wrapper.find('.ant-descriptions-item-no-label')).toHaveLength(1); enquire.callunmatch(); wrapper.unmount(); diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index a641d78863..6bd0e5181a 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -82,7 +82,12 @@ const renderCol = (child: React.ReactElement, bordered: b const { prefixCls, label, className, children, span = 1 } = child.props; if (bordered) { return [ - + {label} , , bordered: b } return ( - + {label} diff --git a/components/descriptions/style/index.less b/components/descriptions/style/index.less index 3abf4742e8..6282cd7533 100644 --- a/components/descriptions/style/index.less +++ b/components/descriptions/style/index.less @@ -51,6 +51,13 @@ } } + &-item-no-label { + &::after { + content: ''; + margin: 0; + } + } + &-item-content { display: table-cell; color: @text-color;