sortablejs进行拖拽排序后,如何恢复到原来的初始状态

拖拽排序插件官网

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

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

_this.rootDepart.sortableObj.destroy(); //销毁排序
_this.rootDepart.sortableObj.cancel(); //网上说取消排序是这样,但是我试了试没效果
阅读 15.5k
3 个回答

使用 toArray() 和 sort()

新手上路,请多包涵

楼主有答案了吗?

this.sortAble = Sortable.create(el)
this.sortAble.option('disabled', true) 这样可以禁止拖拽

推荐问题