let data=[{name:1},{name:2},{name:3}]
//arr:原数组,a:某个对象当前位置,b:某个对象想要移动到的位置
function Move(arr, a, b) {
let arr_temp = [].concat(arr);
arr_temp.splice(b, 0, arr_temp.splice(a, 1)[0]);
return arr_temp;
}
let data=[{name:1},{name:2},{name:3}]
//arr:原数组,a:某个对象当前位置,b:某个对象想要移动到的位置
function Move(arr, a, b) {
let arr_temp = [].concat(arr);
arr_temp.splice(b, 0, arr_temp.splice(a, 1)[0]);
return arr_temp;
}