// 上移
upGo(arr, index) {
if (index > 0) {
this.tableData[index] = this.tableData.splice(
index - 1,
1,
this.tableData[index]
)[0];
} else {
this.tableData.push(this.tableData.shift())
}
},
// 下移
downGo(arr, index) {
if (index != arr.length - 1) {
this.tableData[index] = this.tableData.splice(
index + 1,
1,
this.tableData[index]
)[0];
} else {
this.tableData.unshift(this.tableData.splice(index, 1)[0])
}
},
js表格数据上移,下移功能
最新推荐文章于 2024-02-19 16:33:12 发布