WakuwakuP / element-ui-el-table-draggable

Make 'el-table' of 'element UI' sortable.
https://www.npmjs.com/package/element-ui-el-table-draggable
MIT License
111 stars 19 forks source link

have some bug in Firefox 。火狐会打开检索问题~ #39

Open LuniChang opened 2 years ago

LuniChang commented 2 years ago

sortable.create(table, { handle: this.handle, animation: this.animate, onStart: () => { this.$emit("drag"); }, setData: function(dataTransfer) { // to avoid Firefox bug // Detail see : https://github.com/RubaXa/Sortable/issues/1012 dataTransfer.setData('Text', '') }, onEnd: ({ newIndex, oldIndex }) => { this.keepWrapperHeight(true); this.tableKey = Math.random(); const arr = this.$children[0].data; const targetRow = arr.splice(oldIndex, 1)[0]; arr.splice(newIndex, 0, targetRow); this.$emit("drop", { targetObject: targetRow, list: arr }); } });

LuniChang commented 2 years ago

以上是修复版本