Browse Source
修复表格设置固定列,事件回调数据错误 (#2605)
* fix: 修复异步加载表格列时,表格设置显示列为空
* fix: 修复表格设置固定按钮回调事件,未过滤当前选择的列导致回调数据错误
pull/2607/head
superlollipop
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
src/components/Table/src/components/settings/ColumnSetting.vue
|
|
|
@ -347,7 +347,9 @@ |
|
|
|
function handleColumnFixed(item: BasicColumn, fixed?: 'left' | 'right') { |
|
|
|
if (!state.checkedList.includes(item.dataIndex as string)) return; |
|
|
|
|
|
|
|
const columns = getColumns() as BasicColumn[]; |
|
|
|
const columns = getColumns().filter((c: BasicColumn) => |
|
|
|
state.checkedList.includes(c.dataIndex as string), |
|
|
|
) as BasicColumn[]; |
|
|
|
const isFixed = item.fixed === fixed ? false : fixed; |
|
|
|
const index = columns.findIndex((col) => col.dataIndex === item.dataIndex); |
|
|
|
if (index !== -1) { |
|
|
|
|