From c05a0eb1c3b12c0ecde1bb7dad442d86c2ebdf06 Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Wed, 15 Nov 2023 14:42:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(hooks):=20=E4=BF=AE=E5=A4=8D=E5=9C=A8?= =?UTF-8?q?=E4=BD=BF=E7=94=A8dragSort=E6=97=B6=E4=B8=8D=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=9B=9E=E8=B0=83Props=E5=87=BD=E6=95=B0=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99=20(#3592)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(hooks): 修复在使用dragSort时不使用回调Props函数出现的报错 * fix(hooks): 修复在使用dragSort时不使用回调Props函数出现的报错(补) * fix(hooks): 修复在使用dragSort时不使用回调Props函数出现的报错(补) --- src/hooks/useDragSort.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useDragSort.tsx b/src/hooks/useDragSort.tsx index 40a1784acf..5e93275069 100644 --- a/src/hooks/useDragSort.tsx +++ b/src/hooks/useDragSort.tsx @@ -89,7 +89,7 @@ export default function useDragSort(props: any) { // 当props.theme === "normal" 会多出一个指示条为第一个dom节点,所以需要减1 const currentIndex = props.theme === 'card' ? dragIndex : dragIndex - 1; const endIndex = props.theme === 'card' ? targetIndex : targetIndex - 1; - props.onDragSort({ + props.onDragSort?.({ currentIndex, current: props.panels[currentIndex].value, targetIndex: endIndex,