daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
9.93k stars 616 forks source link

如何让新添加到画布上的组件可拖拽、缩放、旋转呢?How do you make a newly added component to the canvas drag-and-drop, zoom, and rotate? #1078

Open jiangxiaoxilsy opened 8 months ago

jiangxiaoxilsy commented 8 months ago

目前从左侧新增到画布上的组件无法跟Moveable关联起来,chartList是一个动态的组件列表,怎么实现呢?: <div v-for="(item,index) in chartList" :key="index" class="target"

{{ index }}fhsdagjjmxsjfdjkd{{ index }}

<Moveable :target="'.target'" :individual-groupable="true" :draggable="draggable" :throttle-drag="throttleDrag" :edge-draggable="edgeDraggable" :start-drag-rotate="startDragRotate" :throttle-drag-rotate="throttleDragRotate" :resizable="resizable" :keep-ratio="keepRatio" :throttle-scale="throttleScale" :render-directions="renderDirections" :rotatable="rotatable" :throttle-rotate="throttleRotate" :rotation-position="rotationPosition" @drag="onDrag" @resize="onResize" @rotate="onRotate" />

HZZformGD commented 7 months ago

可以试试 把target 换成 变量, 每次数据变化的时候 setTargets