File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -1161,6 +1161,8 @@ export class ProjectKanbanView {
11611161
11621162 column . appendChild ( pagination ) ;
11631163 container . appendChild ( column ) ;
1164+
1165+ return column ;
11641166 }
11651167
11661168 private addDropZoneEvents ( element : HTMLElement , status : string ) {
@@ -1737,6 +1739,12 @@ export class ProjectKanbanView {
17371739 }
17381740
17391741 private async renderKanban ( ) {
1742+ // 在切换模式时完全清空容器,避免不同模式的组件残留
1743+ const kanbanContainer = this . container . querySelector ( '.project-kanban-container' ) as HTMLElement ;
1744+ if ( kanbanContainer ) {
1745+ kanbanContainer . innerHTML = '' ;
1746+ }
1747+
17401748 if ( this . kanbanMode === 'status' ) {
17411749 await this . renderStatusKanban ( ) ;
17421750 } else {
@@ -1756,12 +1764,8 @@ export class ProjectKanbanView {
17561764 return ;
17571765 }
17581766
1759- // 清空现有列(除了标题栏)
17601767 const kanbanContainer = this . container . querySelector ( '.project-kanban-container' ) as HTMLElement ;
1761- if ( kanbanContainer ) {
1762- // 保留标题栏,清空看板内容
1763- kanbanContainer . innerHTML = '' ;
1764- }
1768+ if ( ! kanbanContainer ) return ;
17651769
17661770 // 将任务分为已完成和其他状态
17671771 const completedTasks = this . tasks . filter ( task => task . completed ) ;
@@ -1809,9 +1813,6 @@ export class ProjectKanbanView {
18091813 const kanbanContainer = this . container . querySelector ( '.project-kanban-container' ) as HTMLElement ;
18101814 if ( ! kanbanContainer ) return ;
18111815
1812- // 不再清空整个看板容器,而是保留列结构
1813- // kanbanContainer.innerHTML = '';
1814-
18151816 // 确保状态列存在,如果不存在才创建
18161817 this . ensureStatusColumnsExist ( kanbanContainer ) ;
18171818
You can’t perform that action at this time.
0 commit comments