fix:修复拖拽节点,顺序错误bug

This commit is contained in:
fanxb 2020-02-01 23:51:04 +08:00
parent 34d0006f55
commit 11d4f2de95

View File

@ -140,7 +140,7 @@ export async function moveNode(info) {
//移动节点相对于目标节点位置的增量
let addIndex = info.dropPosition > index ? 1 : 0;
body.sort = target.sort + addIndex;
targetList.splice(addIndex, 0, current);
targetList.splice(index + addIndex, 0, current);
for (let i = index + 1; i < targetList.length; i++) {
targetList[i].sort += 1;
}