数组上下移动
时间:2020-01-03 18:03:30
收藏:0
阅读:115
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
评论(0)