Skip to content

Commit c8a6f97

Browse files
committed
chore: optimize the animation effect
1 parent 097bd95 commit c8a6f97

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

dist/virtual-drag-list.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-draglist v3.3.5
2+
* vue-virtual-draglist v3.3.6
33
* open source under the MIT license
44
* https://github.com./mfuu/vue3-virtual-drag-list#readme
55
*/
@@ -890,8 +890,12 @@
890890
}, {});
891891
this.sortable = new Dnd(this.el, Object.assign(Object.assign({}, props), {
892892
emptyInsertThreshold: 0,
893-
swapOnDrop: false,
894-
removeCloneOnDrop: false,
893+
swapOnDrop: function swapOnDrop(event) {
894+
return event.from === event.to;
895+
},
896+
removeCloneOnDrop: function removeCloneOnDrop(event) {
897+
return event.from === event.to;
898+
},
895899
onDrag: function onDrag(event) {
896900
return _this.onDrag(event);
897901
},
@@ -961,7 +965,9 @@
961965
if (event.from === this.el && this.reRendered) {
962966
(_b = Dnd.dragged) === null || _b === void 0 ? void 0 : _b.remove();
963967
}
964-
(_c = Dnd.clone) === null || _c === void 0 ? void 0 : _c.remove();
968+
if (event.from !== event.to) {
969+
(_c = Dnd.clone) === null || _c === void 0 ? void 0 : _c.remove();
970+
}
965971
this.reRendered = false;
966972
}
967973
}, {

dist/virtual-drag-list.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-virtual-draglist",
3-
"version": "3.3.5",
3+
"version": "3.3.6",
44
"description": "A virtual scrolling list component that can be sorted by dragging, support vue3",
55
"main": "dist/virtual-drag-list.min.js",
66
"types": "types/index.d.ts",

src/core

Submodule core updated 1 file

0 commit comments

Comments
 (0)