//import draggable from 'vuedraggable'
// 拖拽
onDragEnd(e) {
if (e.newIndex != e.oldIndex) {
let listData = this.formData.listData;
listData[e.newIndex] = listData.splice(e.oldIndex, 1, listData[e.newIndex])[0];
}
},
// 上移
onUpGo(index) {
let listData = this.formData.listData;
if (index !=0 ) {
listData[index] = listData.splice(index-1, 1, listData[index])[0];
} else {
listData.push(listData.shift());
}
},
// 下移
onDownGo(index) {
let listData = this.formData.listData;
if (index != listData.length - 1) {
listData[index] = listData.splice(index+1, 1, listData[index])[0];
} else {
listData.unshift(listData.splice(index, 1))[0];
}
},
网友评论