//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];
}
},
表單項(xiàng)上移、下移、交換位置
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
相關(guān)閱讀更多精彩內(nèi)容
- //交換 alterItem:function(arr, index1, index2) { arr[index1...
- 1. 概述 這篇文章主要記錄下自己在開發(fā)過程中,需要交換list集合中相鄰兩個(gè)位置的數(shù)據(jù),需求如下: 2. ...
- 前端界面如圖所示: 首先,想要實(shí)現(xiàn)置頂操作,需要在button按鈕上添加點(diǎn)擊事件(這里使用的是確定框),然后發(fā)送a...
- 1、 //scrollView滾動(dòng)時(shí),就調(diào)用該方法。任何offset值改變都調(diào)用該方法。即滾動(dòng)過程中,調(diào)用多次 -...