Skip to content

Commit c9f1556

Browse files
cs1707abigail-0111
authored andcommitted
Descriptions: fix label slot bug (ElemeFE#21462)
1 parent 788c386 commit c9f1556

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/descriptions/src/descriptions-row.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default {
100100
[item.labelClassName]: true
101101
}}
102102
style={item.labelStyle}
103-
>{item.props.label}</span>
103+
>{item.label}</span>
104104
<span
105105
class={['el-descriptions-item__content', item.contentClassName]}
106106
style={item.contentStyle}

packages/theme-chalk/src/descriptions-item.scss

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@
22
@import 'common/var';
33

44
@include b(descriptions-item) {
5+
vertical-align: top;
56

67
@include e(container) {
78
display: flex;
9+
10+
.el-descriptions-item__label,
11+
.el-descriptions-item__content {
12+
display: inline-flex;
13+
align-items: baseline;
14+
}
15+
.el-descriptions-item__content {
16+
flex: 1;
17+
}
818
}
919

1020
@include e(label) {
@@ -20,13 +30,13 @@
2030
color: $--color-text-secondary;
2131
background: $--descriptions-item-bordered-label-background;
2232
}
23-
2433
&:not(.is-bordered-label) {
2534
margin-right: 10px;
2635
}
2736
}
2837

2938
@include e(content) {
30-
39+
word-break: break-word;
40+
overflow-wrap: break-word;
3141
}
3242
}

0 commit comments

Comments
 (0)