diff --git a/components/apolloTable/component/DragSorted.tsx b/components/apolloTable/component/DragSorted.tsx index e4b9dc4d4d7bee73d9705e9eaaf260d7527b3d70..53b66a74e6abb3175ab25461037f0d6be801132b 100644 --- a/components/apolloTable/component/DragSorted.tsx +++ b/components/apolloTable/component/DragSorted.tsx @@ -128,10 +128,18 @@ const DragSorted = (props: any) => { { columnName: dropColumn, orderNo: Number(dropColumnOrder) }, ); } - }, []); + }, [onDropFinish]); // 监听鼠标按下 const onMouseDown = useCallback( (e) => { + // 没有拖拽回调,默认不支持拖拽事件 + if (!onDropFinish) { + return; + } + // 不是左键点击不作处理 + if (e.button !== 0) { + return; + } // 表格初始位置x点 const originLeft = container.getBoundingClientRect().x || 0; // 拖动列矩形