Droppable
Mixin
internal
Mix this into another class to enable drop support and receive drops from draggables.
There are 4 basic methods that a droppable implements. These methods are called as drag operations occur:
class MyDroppable extends Base.mixin(Droppable) {
dragEnter(drag) {
// a drag has entered the drop zone... create some type of drop indicator perhaps
}
dragMove(drag) {
// a drag has changed position... update drop indicators
}
dragDrop(drag) {
// drop has occurred... process data from the drag context
}
dragLeave(drag) {
// the drag has left the drop zone... cleanup indicators
}
}
Instances of Droppable are associated with an element to receive drag operations:
let target = new MyDroppable({
dropRootElement : someElement
});
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Set this config to the element where drops should be received. When set, the
b-droppableCSS class is added to the element and theDroppableinstance is associated with that element so that it can be found by draggables. -
A selector, which, if specified, narrows the dropability to child elements of the dropRootElement which match this selector.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of Droppable class, or subclass thereof.
-
Return the
Eventsinstance from which drop events are fired. -
Returns the CSS class that is added to the dropRootElement, i.e.,
'b-droppable'. -
Identifies an object as an instance of Droppable class, or subclass thereof.