// 上移下移
moveUp(index, row) {
var that = this
if (index > 0) {
const upDate = that.tableData[index - 1]
that.tableData.splice(index - 1, 1)
that.tableData.splice(index, 0, upDate)
} else {
this.$message.warning('已经是第一条,不可上移')
}
},
// 向下移动
moveDown(index, row) {
var that = this
if ((index + 1) === that.tableData.length) {
this.$message.warning('已经是最后一条,不可下移')
} else {
const downDate = that.tableData[index + 1]
that.tableData.splice(index + 1, 1)
that.tableData.splice(index, 0, downDate)
}
},
列表上移下移
于 2021-07-30 14:59:01 首次发布