ant-design / ant-design/pro-components

🐛[BUG] ProTable的列设置columnsState属性中,persistenceType: 'localStorage',设置了保存本地,接着点击了全选列之后,刷新页面(刷新页面是因为保存本地之后,模拟重新进入页面)后点击【重置】回不去之前的初始化了。因为刷新页面之后点击【重置】按钮,本地缓存的该条记录被清除了,所以列表列没变化

Open
#8,620 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

提问前先看看:

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

### 🐛 bug 描述
ProTable的列设置columnsState属性中,persistenceType: 'localStorage',设置了保存本地,接着点击了全选列之后,刷新页面(刷新页面是因为保存本地之后,模拟重新进入页面)后点击【重置】回不去之前的初始化了。因为刷新页面之后点击【重置】按钮,本地缓存的该条记录被清除了,所以列表列没变化。

### 📷 复现步骤
persistenceType: 'localStorage',设置保存本地,设置好列表显示字段之后点击全选列,接着刷新页面,然后点击【重置】回不去之前的初始化了列字段了。

### 🏞 期望结果
刷新页面之后点击【重置】,希望把 defaultValue 里设置好的初始化列显示出来

### 💻 复现代码

### © 版本信息

- ProComponents 版本: [e.g. 4.0.0] 2.6.48
- umi 版本 4.3.6
- 浏览器环境
- 开发环境 [e.g. mac OS]

### 🚑 其他信息

Contributor guide

Open the contributing guide

Research direction

Start at ProTable's columnsState handling for localStorage persistence and the reset action. Reproduce the reported sequence with persistenceType set to localStorage: select all columns, refresh, then click reset; done means the configured defaultValue columns are restored after refresh.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.