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
91
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
92
93
+
#### move
94
+
Type: `Function`<br>
95
+
Required: `false`<br>
96
+
Default: `null`<br>
97
+
98
+
If not null this function will be called in a similar way as [Sortable onMove callback](https://github.com/RubaXa/Sortable#move-event-object).
99
+
Returning false will cancel the drag operation.
100
+
101
+
```javascript
102
+
functiononMoveCallback(evt, originalEvent){
103
+
...
104
+
// return false; — for cancel
105
+
}
106
+
```
107
+
evt object has same property as [Sortable onMove event](https://github.com/RubaXa/Sortable#move-event-object), plus two addicional properties:
108
+
`move event` object addicional properties:
109
+
- `draggedContext`: context linked to dragged element
110
+
- `index`: dragged element index
111
+
- `element`: dragged element underlying view model element
112
+
- `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
136
[See here for reference](https://github.com/RubaXa/Sortable#event-object-demo)
86
137
138
+
The OnMove callback is mapped with the [move prop](https://github.com/SortableJS/Vue.Draggable/blob/master/README.md#move)
0 commit comments