fix(menu): drag issue (#6315)

This commit is contained in:
Zeke Zhang 2025-02-27 12:08:33 +08:00 committed by GitHub
parent 2b829e682c
commit bb044f1176
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -526,14 +526,10 @@ export const useMenuDragEnd = () => {
return; return;
} }
const fromIndex = activeSchema.__route__.sort;
const toIndex = overSchema.__route__.sort;
moveRoute({ moveRoute({
sourceId: activeSchema.__route__.id, sourceId: activeSchema.__route__.id,
targetId: overSchema.__route__.id, targetId: overSchema.__route__.id,
sortField: 'sort', sortField: 'sort',
method: fromIndex > toIndex ? 'prepend' : 'insertAfter',
}); });
}, },
[moveRoute], [moveRoute],