ant-design / ant-design/pro-components
🐛[BUG]pro-table升级小版本以后设置pagination={{ pageSize: 10/20/50 }},分页器不生效
- 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 描述
1. pro-table 版本 2.80.3及以上
2. 给pro-table设置pageSize值
3. 分页器进行切换的时候一直不生效,一直是设置的默认值
### 📷 复现步骤
### 🏞 期望结果
不管什么版本,给pro-table设置都生效
### 💻 复现代码

看了源码以后,发现是bug,如上图所示,pagination.pageSize !== null && pagination.pageSize !== undefined一直为true,导致一直拿的只是props.pagination的值,所以一直是默认值
改成pagination={{ defaultPageSize: 10/20/50 }}就没问题
- ProComponents 版本: [2.80.3]
- umi 版本
- 浏览器环境
- 开发环境 [e.g. mac OS]
### 🚑 其他信息
Contributor guide
Research direction
Start at the ProTable pagination entry point and reproduce the issue on version 2.80.3 or later with pagination={{ pageSize: 10/20/50 }}. Trace the pagination.pageSize checks described in the report and compare them with defaultPageSize behavior. Done means switching the paginator uses the configured pageSize values rather than always retaining the default.
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
- 42/100