Skip to content

Commit

Permalink
fix: columnsState.defaultValue be modified with lodash merge function (
Browse files Browse the repository at this point in the history
  • Loading branch information
lidianhao123 authored Sep 4, 2024
1 parent 8acaa16 commit 9151e33
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/table/src/Store/Provide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ function useContainer(props: UseContainerProps = {} as Record<string, any>) {
if (props?.columnsState?.defaultValue) {
// 实际生产中,defaultValue往往作为系统方默认配置,则优先级不应高于用户配置的storageValue
return merge(
{},
props?.columnsState?.defaultValue,
JSON.parse(storageValue),
);
Expand Down Expand Up @@ -129,6 +130,7 @@ function useContainer(props: UseContainerProps = {} as Record<string, any>) {
if (props?.columnsState?.defaultValue) {
setColumnsMap(
merge(
{},
props?.columnsState?.defaultValue,
JSON.parse(storageValue),
),
Expand Down

0 comments on commit 9151e33

Please sign in to comment.