Open wangruiStart opened 4 days ago
没明白此PR解决了什么问题,能不能说明下
没明白此PR解决了什么问题,能不能说明下
当table的dataIndex是数组时,之前的逻辑会判断 title,但是判断逻辑写的有问题,应该是typeof title.导致最后的columnOptions的value是空字符串。进而导致tableColumnsUpdate方法中const colIdx = columns.findIndex((o) => o.key === opt.value);
colIdx找不到,所有dataindex为数组的列都会被插到最后,改变了原有配置的columns的顺序
这个代码错误好低级,在我使用这样的dataIndex的时候 排序功能就失效
{
title: '歌手',
dataIndex: ['artist', 'name'],
width: 200,
},
经过我的排查 发现 src/components/Table/src/components/settings/ColumnSetting.vue:547行以及上面的542行的label 都有该错误
错误非常低级
options.push({
label:
typeof col.title === "string"
? col.title
: col.customTitle === "string" // ???? 只有当col.customTitle 的值为string的时候才去使用col.customTitle 吗 typeof呢 我请问
? col.customTitle
: "",
value:
typeof col.dataIndex === "string"
? col.dataIndex
: col.title === "string" // ???? 只有当col.title的值为string的时候才去使用col.title吗 typeof呢 我请问
? col.title
: "",
column: {
defaultHidden: col.defaultHidden,
},
fixed: col.fixed,
});
I think we can close this PR? The issue was solved in dd1b16acdcf4b02daf48e998e3af44619a8cb403
EDITED
I think we can close this PR? The was solved in 64a4992
This error pertains to the fix in the Ant Design Vue Table component, not the Vxe-Table component.
General
Type
Checklist