Skip to content

Commit

Permalink
fix(hooks): 修复在使用dragSort时不使用回调Props函数出现的报错 (#3592)
Browse files Browse the repository at this point in the history
* fix(hooks): 修复在使用dragSort时不使用回调Props函数出现的报错

* fix(hooks): 修复在使用dragSort时不使用回调Props函数出现的报错(补)

* fix(hooks): 修复在使用dragSort时不使用回调Props函数出现的报错(补)
  • Loading branch information
SuperManito authored Nov 15, 2023
1 parent 38e9ed9 commit c05a0eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useDragSort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c05a0eb

Please sign in to comment.