Skip to content

Commit

Permalink
fix(descriptions-item): prop label-class and content-class not wo…
Browse files Browse the repository at this point in the history
…rking, closes #6290
  • Loading branch information
jizai1125 committed Jan 12, 2025
1 parent c96427d commit 13a646e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## NEXT_VERSION

`xxxx-xx-xx`

### Fixes

- Fix `n-descriptions-item`'s prop `label-class` and `content-class` not working, closes [#6290](https://github.com/tusen-ai/naive-ui/issues/6290).

## 2.41.0

### Breaking Changes
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## NEXT_VERSION

`xxxx-xx-xx`

### Fixes

- 修复 `n-descriptions-item` 的属性 `label-class``content-class` 不生效, 关闭 [#6290](https://github.com/tusen-ai/naive-ui/issues/6290)

## 2.41.0

`2025-01-05`
Expand Down
6 changes: 4 additions & 2 deletions src/descriptions/src/Descriptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ export default defineComponent({
const children = defaultSlots ? flatten(defaultSlots()) : []
const memorizedLength = children.length
const {
contentClass,
labelClass,
compitableColumn,
labelPlacement,
labelAlign,
Expand Down Expand Up @@ -202,8 +200,12 @@ export default defineComponent({
state.span += itemSpan
const labelStyle
= props.labelStyle || props['label-style'] || this.labelStyle
const labelClass
= props.labelClass || props['label-class'] || this.labelClass
const contentStyle
= props.contentStyle || props['content-style'] || this.contentStyle
const contentClass
= props.contentClass || props['content-class'] || this.contentClass
if (labelPlacement === 'left') {
if (bordered) {
state.row.push(
Expand Down

0 comments on commit 13a646e

Please sign in to comment.