ant-design / ant-design/pro-components
DragSortTable 当存在删除功能时,始终会保留一条数据,无法重新渲染为无数据🐛[BUG]
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
### 🐛 bug 描述
使用DragSortTable并通过后端API实现删除功能时,表格的表现始终会保留一条数据,无法重新渲染为 暂无数据,其实后端已经删除成功。
但是,当我改为`ProTable`,并注释掉 `onDragSortEnd` 和 `dragSortKey` 属性后,并没有这个问题
### 📷 复现步骤
1、通过API获取数据。
2、通过API一行一行删除数据。但是表格始终会保留一条数据。但是后端已经删除成功!
### 🏞 期望结果
期望像`ProTable`一样,最后变成 暂无数据。
### 💻 复现代码
``` golang
const columns: ProColumns[] = [
{
title: '操作',
fixed: 'right',
width: 150,
valueType: 'option',
render: (text, record, _, action) => [
{
await remove({ id: record.id });
actionRef.current?.reload();
}}
>
删除
,
],
},
]
```
### © 版本信息
- ProComponents 版本: 2.6.28
- umi 版本:umijs/max 4.0.83
- 浏览器环境
- 开发环境 [e.g. mac OS]
### 🚑 其他信息
比如一开始有3条数据

删除到最后一条时,表格始终会保留一条数据,无法重新渲染为 暂无数据

Contributor guide
Research direction
Start with the DragSortTable implementation and compare its reload behavior with ProTable, using the reported request, dragSortKey, and onDragSortEnd configuration. Reproduce deleting the final row through the API and verify that reload renders the empty-state view instead of retaining one row.
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