OptionaldraggableOptionaledgeWhether to move by dragging the edge line
OptionalhideHides the guidelines that appear when using the throttleDragRotate prop.
OptionalonWhen dragging, the drag event is called.
OptionalonWhen the drag finishes, the dragEnd event is called.
OptionalonWhen the group drag, the dragGroup event is called.
import Moveable from "@moveable-next/vanilla";
const moveable = new Moveable(document.body, {
target: [].slice.call(document.querySelectorAll(".target")),
draggable: true
});
moveable.on("dragGroup", ({ targets, events }) => {
console.log("onDragGroup", targets);
events.forEach(ev => {
// drag event
console.log("onDrag left, top", ev.left, ev.top);
// ev.target!.style.left = `${ev.left}px`;
// ev.target!.style.top = `${ev.top}px`;
console.log("onDrag translate", ev.dist);
ev.target!.style.transform = ev.transform;)
});
});
OptionalonWhen the group drag finishes, the dragGroupEnd event is called.
OptionalonWhen the group drag starts, the dragGroupStart event is called.
OptionalonWhen the drag starts, the dragStart event is called.
Optionalstartstart angle(degree) of x,y for throttleDragRotate when drag.
Optionalthrottlethrottle of x, y when drag.
Optionalthrottlethrottle of angle(degree) of x,y when drag.
Whether or not target can be dragged.