数组上下移动

swapItems(arr, index1, index2) {
    arr[index1] = arr.splice(index2, 1, arr[index1])[0];
    return arr;
},
upStep(index) {
   const newArray = this.swapItems(this.paramTbObj.dataList, index, index - 1);
},
downStep(index) {
   const newArray = this.swapItems(this.paramTbObj.dataList, index, index + 1);
},
原文地址:https://www.cnblogs.com/niluiquhz/p/12145364.html