Unverified Commit f05cc6d3 authored by qinjiahui01's avatar qinjiahui01 Committed by GitHub

fix(useColumn): fixed table column changes with hidden columns disappearing after dropping (#453)

Co-authored-by: 's avatarAlan <alan@ichestnuts.com>
parent 8b5cbca3
...@@ -207,6 +207,11 @@ export function useColumns( ...@@ -207,6 +207,11 @@ export function useColumns(
...item, ...item,
defaultHidden: false, defaultHidden: false,
}); });
} else {
newColumns.push({
...item,
defaultHidden: true,
});
} }
}); });
...@@ -214,8 +219,8 @@ export function useColumns( ...@@ -214,8 +219,8 @@ export function useColumns(
if (!isEqual(cacheKeys, columns)) { if (!isEqual(cacheKeys, columns)) {
newColumns.sort((prev, next) => { newColumns.sort((prev, next) => {
return ( return (
columnKeys.indexOf(prev.dataIndex as string) - cacheKeys.indexOf(prev.dataIndex as string) -
columnKeys.indexOf(next.dataIndex as string) cacheKeys.indexOf(next.dataIndex as string)
); );
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment