antd vue 使用Sortable.js这个插件,如何实现多行数据一起拖动
目前只能实现一行的拖动
官网提供的多选方法
new Sortable(el, {
multiDrag: true, // Enable the plugin
selectedClass: "sortable-selected", // Class name for selected item
multiDragKey: null, // Key that must be down for items to be selected
avoidImplicitDeselect: false, // true - if you don't want to deselect items on outside click
// Called when an item is selected
onSelect: function(/**Event*/evt) {
evt.item // The selected item
},
// Called when an item is deselected
onDeselect: function(/**Event*/evt) {
evt.item // The deselected item
}
});
提供的事件属性方法和索引对象获取不到选中的元素内容
只能获取到对应的html
onSelect:({oldIndicies}) => {
// let arr = oldIndicies // The selected item
console.log(oldIndicies);
},
onDeselect:({oldIndicies}) => {
console.log(oldIndicies);
},
是我写的方式不对吗,请各位大佬指教一下