Skip to content

Commit

Permalink
fix: fixed an error in dragging table demo
Browse files Browse the repository at this point in the history
  • Loading branch information
binyellow committed Feb 19, 2024
1 parent 545d5b5 commit 6e8dbb3
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,29 @@ export default () => {
const actionRef = useRef<ActionType>();
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;
Expand Down

0 comments on commit 6e8dbb3

Please sign in to comment.