From 6e8dbb378f2f05fa5cd3dc7cf21785d15932d6ab Mon Sep 17 00:00:00 2001 From: binyellow <571704908@qq.com> Date: Mon, 19 Feb 2024 17:25:44 +0800 Subject: [PATCH] fix: fixed an error in dragging table demo --- .../DragSortTable/demos/drag-sort-table.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/table/src/components/DragSortTable/demos/drag-sort-table.tsx b/packages/table/src/components/DragSortTable/demos/drag-sort-table.tsx index 1231f26cc2bf..6e91177a5a00 100644 --- a/packages/table/src/components/DragSortTable/demos/drag-sort-table.tsx +++ b/packages/table/src/components/DragSortTable/demos/drag-sort-table.tsx @@ -90,17 +90,29 @@ export default () => { const actionRef = useRef(); const [dataSource1, setDatasource1] = useState(data); const [dataSource2, setDatasource2] = useState(data); - const handleDragSortEnd1 = (newDataSource: any) => { + const handleDragSortEnd1 = ( + beforeIndex: number, + afterIndex: number, + newDataSource: any, + ) => { console.log('排序后的数据', newDataSource); setDatasource1(newDataSource); message.success('修改列表排序成功'); }; - const handleDragSortEnd2 = (newDataSource: any) => { + const handleDragSortEnd2 = ( + beforeIndex: number, + afterIndex: number, + newDataSource: any, + ) => { console.log('排序后的数据', newDataSource); setDatasource2(newDataSource); message.success('修改列表排序成功'); }; - const handleDragSortEnd3 = (newDataSource: any) => { + const handleDragSortEnd3 = ( + beforeIndex: number, + afterIndex: number, + newDataSource: any, + ) => { console.log('排序后的数据', newDataSource); // 模拟将排序后数据发送到服务器的场景 remoteData = newDataSource;