You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function called on the source component to clone element when clone option is true. The unique argument is the viewModel element to be cloned and the returned value should be its cloned version.<br>
80
80
By default vue.draggable reuse the viewmodel element, so you have to use this hook if you want to clone or deep clone it.
81
81
82
+
#### move
83
+
Type: `Function`<br>
84
+
Required: `false`<br>
85
+
Default: `null`<br>
86
+
87
+
If not null this function will be called in a similar way as [Sortable onMove callback](https://github.com/RubaXa/Sortable#move-event-object).
88
+
Returning false will cancel the drag operation.
89
+
90
+
```javascript
91
+
functiononMoveCallback(evt, originalEvent){
92
+
...
93
+
// return false; — for cancel
94
+
}
95
+
```
96
+
evt object has same property as [Sortable onMove event](https://github.com/RubaXa/Sortable#move-event-object), plus two addicional properties:
97
+
`move event` object addicional properties:
98
+
-`draggedContext`: context linked to dragged element
99
+
- `index`: dragged element index
100
+
- `element`: dragged element underlying view model element
101
+
-`relatedContext`: context linked to current drag position
See complete example: [Cancel.html](https://github.com/SortableJS/Vue.Draggable/blob/master/examples/Cancel.html), [cancel.js](https://github.com/SortableJS/Vue.Draggable/blob/master/examples/script/cancel.js)
events are called when respectivelly onStart, onAdd, onRemove, onUpdate, onEnd, onChoose, onSort, onClone are fired by Sortabe.js with the same argument.<br>
85
125
[See here for reference](https://github.com/RubaXa/Sortable#event-object-demo)
86
126
127
+
The OnMove callback is mapped with the [move prop]()
0 commit comments