From a6ce9192ecbc3a8d99e309536c97556e975d98a5 Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Thu, 17 Dec 2020 20:14:22 +0800 Subject: [PATCH] fix bug --- components/apolloTable/component/DragResized.tsx | 16 ++++++++-------- components/apolloTable/component/DragSorted.tsx | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/apolloTable/component/DragResized.tsx b/components/apolloTable/component/DragResized.tsx index 7820a7d..a4bdcc9 100644 --- a/components/apolloTable/component/DragResized.tsx +++ b/components/apolloTable/component/DragResized.tsx @@ -48,14 +48,6 @@ const DragResized = (props: any) => { } newColumns.push(item); }); - // 业务回调 - if (typeof onDragResized === 'function') { - onDragResized(newColumns); - } - // table回调 - if (typeof onDragResizedCb === 'function') { - onDragResizedCb(newColumns); - } // 缓存操作 if (cachedFeAttr) { const cachedCols = getCache({ tableId }); @@ -67,6 +59,14 @@ const DragResized = (props: any) => { saveCache({ tableId, data: cachedCols }); } } + // 业务回调 + if (typeof onDragResized === 'function') { + onDragResized(newColumns); + } + // table回调 + if (typeof onDragResizedCb === 'function') { + onDragResizedCb(newColumns); + } }; return ( diff --git a/components/apolloTable/component/DragSorted.tsx b/components/apolloTable/component/DragSorted.tsx index c0dbde1..7c83406 100644 --- a/components/apolloTable/component/DragSorted.tsx +++ b/components/apolloTable/component/DragSorted.tsx @@ -187,9 +187,9 @@ const DragSorted = (props: any) => { if (typeof onDragSorted === 'function') { onDragSorted(newColumns); } - // if (typeof onDragSortedCb === 'function') { - // onDragSortedCb(newColumns); - // } + if (typeof onDragSortedCb === 'function') { + onDragSortedCb(newColumns); + } }, [onDragSortedCb, onDragSorted, columns]); // 监听鼠标按下 const onMouseDown = useCallback( -- 2.21.0