Skip to content

Commit

Permalink
fix(table): activeRowList assignment error when `activeRowType = mu…
Browse files Browse the repository at this point in the history
…ltiple` (#4010)

* docs(table): update table demo

* fix(table): `activeRowList` assignment error when `activeRowType = true` (#4000)

---------

Co-authored-by: 陈煜坚 <chenyujian@oigcn.cn>
  • Loading branch information
XBIsland and 陈煜坚 committed Mar 11, 2024
1 parent 27fd2d3 commit c2d6f26
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/table/hooks/useRowHighlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,16 @@ export function useRowHighlight(props: BaseTableProps, tableRef: Ref<HTMLDivElem
});
} else if (activeRowType.value === 'multiple') {
const newActiveRowKeys = tActiveRow.value.filter((t) => t !== rowValue);
const activeRowList: { row: TableRowData; rowIndex: number }[] = [];
for (let i = 0, len = data.value.length; i < len; i++) {
const row = data.value[i];
if (newActiveRowKeys.includes(get(row, props.rowKey))) {
activeRowList.push({ row, rowIndex: i });
}
}
setTActiveRow(newActiveRowKeys, {
type: 'inactive',
activeRowList: [],
activeRowList,
currentRowData: row,
});
}
Expand Down

0 comments on commit c2d6f26

Please sign in to comment.