From 13a646ee37a8709409baa26185be88d17e6a6c1b Mon Sep 17 00:00:00 2001 From: jizai1125 <1414589221@qq.com> Date: Sun, 12 Jan 2025 12:20:03 +0800 Subject: [PATCH] fix(descriptions-item): prop `label-class` and `content-class` not working, closes #6290 --- CHANGELOG.en-US.md | 8 ++++++++ CHANGELOG.zh-CN.md | 8 ++++++++ src/descriptions/src/Descriptions.tsx | 6 ++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index e3aafc826d9..55a96513ce1 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -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 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index dd6c97db9d9..de6335b368e 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -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` diff --git a/src/descriptions/src/Descriptions.tsx b/src/descriptions/src/Descriptions.tsx index 2a787a25e16..2ed636cf6a2 100644 --- a/src/descriptions/src/Descriptions.tsx +++ b/src/descriptions/src/Descriptions.tsx @@ -156,8 +156,6 @@ export default defineComponent({ const children = defaultSlots ? flatten(defaultSlots()) : [] const memorizedLength = children.length const { - contentClass, - labelClass, compitableColumn, labelPlacement, labelAlign, @@ -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(