ant-design / ant-design/pro-components
🐛[BUG] pro table 组件使用sorter排序 会意外发起请求
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
### 🐛 bug 描述
pro table 组件使用sorter排序会意外发起请求
### 📷 复现步骤
使用protable 组件 为列增加一个 sorter
点击表头进行排序
### 🏞 期望结果
不应产生任何的网络请求,排序仅在前端进行.
### 🏞 实际结果
每点击一次表头会发起一次request. 增加后端负担,产生了不必要的请求.
### 💻 复现代码
```
columns = [
{
title: 'File Name',
dataIndex: 'name',
key: 'name',
defaultSortOrder: 'ascend',
sorter: (a: any, b: any) => {
return a.name.localeCompare(b.name);
},
}
];
```
### © 版本信息
- ProComponents 版本: 2.7.0
- umi 版本
- 浏览器环境
- 开发环境 [e.g. mac OS]
### 🚑 其他信息
Contributor guide
Research direction
Start at the ProTable entry point and trace how the request prop (this.getData) is triggered when the column sorter runs. Reproduce the columns example with the local sorter, then verify that clicking the header changes client-side ordering without issuing a network request.
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
- 35/100