ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.04k stars 1.29k forks source link

🐛[BUG] ProTable ColumnState 始终使用默认值 #8314

Closed fnoopv closed 3 weeks ago

fnoopv commented 4 weeks ago

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

ProTableColumnState现在始终使用defaultValue,导致所有自定义无法生效,违背列该字段的原始初衷。找了一下,更改来自 #7979, 始终会使用defaultValue合并进现有的storageValuehttps://github.com/ant-design/pro-components/blob/daa9eae620a93d6c633f87b230b6e38676e999e6/packages/table/src/Store/Provide.tsx#L130C1-L133C17

📷 复现步骤

部分代码

columnsState={{
          defaultValue: defaultHiddenColumn,
          persistenceKey: 'asset-app',
          persistenceType: 'localStorage',
        }}

🏞 期望结果

自定义的列可以正常存储

💻 复现代码

© 版本信息

🚑 其他信息

github-actions[bot] commented 4 weeks ago

以下的 Issues 可能会帮助到你 / The following issues may help you

fnoopv commented 4 weeks ago

ref #8267

fnoopv commented 4 weeks ago

8267 合并后没有发版吗 @chenshuai2144

chenshuai2144 commented 3 weeks ago

发布了,可以再试试了