Skip to content

Commit babaff7

Browse files
Add log on move
1 parent 20572ac commit babaff7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/src/vuedragablefor.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@
3030

3131
mix(clonedForDirective, {
3232
bind : function () {
33-
this.sortable = new Sortable(this.el.parentElement, {});
33+
var option ={
34+
onEnd: function (evt) {
35+
evt.oldIndex; // element's old index within parent
36+
evt.newIndex; // element's new index within parent
37+
console.log(evt.oldIndex, evt.newIndex);
38+
}
39+
};
40+
this.sortable = new Sortable(this.el.parentElement, option);
3441
},
3542
update : function(){
3643
console.log(this.sortable)

0 commit comments

Comments
 (0)