v1.6.1 - Bugfix 声明式Task列表展示问题

This commit is contained in:
LINING-PC\lining
2025-12-15 12:53:45 +08:00
parent e72b4958e6
commit 9de2d729d8
5 changed files with 22 additions and 6 deletions

View File

@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.6.1] - 2025-12-15
### Fixed
- 🔧 修复声明式Task List数据展示问题
- 🔧 Fixed: Declarative Task List data display issue
## [1.6.0] - 2025-12-14
### Added

View File

@@ -400,5 +400,13 @@
"🔧 Fixed: Fixed issues",
"<span style=\"font-weight: bold; color: #f00;\">Special thanks to osc_85545913@gitee for their use and feedback</span>"
]
},
{
"version": "1.6.1",
"date": "2025-12-15",
"notes": [
"🔧 修复声明式Task List数据展示问题",
"🔧 Fixed: Declarative Task List data display issue"
]
}
]

View File

@@ -1,6 +1,6 @@
{
"name": "jordium-gantt-vue3",
"version": "1.6.0",
"version": "1.6.1",
"type": "module",
"main": "npm-package/dist/jordium-gantt-vue3.cjs.js",
"module": "npm-package/dist/jordium-gantt-vue3.es.js",

View File

@@ -57,7 +57,7 @@ const { t } = useI18n()
// 使用声明式列管理 composable
const { declarativeColumns, getColumnWidthStyle: getDeclarativeColumnWidth } =
useTaskListColumns(
props.taskListColumnRenderMode || 'default',
computed(() => props.taskListColumnRenderMode || 'default'),
slots,
props.taskListConfig?.columns || DEFAULT_TASK_LIST_COLUMNS,
)

View File

@@ -1,4 +1,4 @@
import { computed, type VNode, type Slots, type VNodeChild } from 'vue'
import { computed, type VNode, type Slots, type VNodeChild, type ComputedRef } from 'vue'
import type { Task } from '../models/classes/Task'
import type { TaskListColumnConfig } from '../models/configs/TaskListConfig'
@@ -111,13 +111,14 @@ export function parseDeclarativeColumns(slots: Slots): DeclarativeColumnConfig[]
* 用于管理任务列表的列配置(支持声明式和配置式)
*/
export function useTaskListColumns(
renderMode: 'default' | 'declarative',
renderMode: ComputedRef<'default' | 'declarative'> | 'default' | 'declarative',
slots: Slots,
defaultColumns?: TaskListColumnConfig[],
) {
// 声明式列配置
const declarativeColumns = computed(() => {
if (renderMode !== 'declarative') {
const mode = typeof renderMode === 'string' ? renderMode : renderMode.value
if (mode !== 'declarative') {
return []
}
return parseDeclarativeColumns(slots)
@@ -125,7 +126,8 @@ export function useTaskListColumns(
// 最终使用的列配置
const finalColumns = computed(() => {
if (renderMode === 'declarative') {
const mode = typeof renderMode === 'string' ? renderMode : renderMode.value
if (mode === 'declarative') {
return declarativeColumns.value
}
return defaultColumns || []