鍍金池/ 問答/Python  C  網(wǎng)絡(luò)安全  HTML/ sortablejs進行拖拽排序后,如何恢復到原來的初始狀態(tài)

sortablejs進行拖拽排序后,如何恢復到原來的初始狀態(tài)

拖拽排序插件官網(wǎng)

var _this = this;
var el = document.getElementById('rootChildDeparts');

_this.rootDepart.sortableObj = Sortable.create(el);

_this.rootDepart.sortableObj.destroy(); //銷毀排序
_this.rootDepart.sortableObj.cancel(); //網(wǎng)上說取消排序是這樣,但是我試了試沒效果
回答
編輯回答
大濕胸

使用 toArray() 和 sort()

2018年8月29日 13:42