diff --git a/src/components/spray/trayGraph/index.vue b/src/components/spray/trayGraph/index.vue index 4e55508..9ba59d0 100644 --- a/src/components/spray/trayGraph/index.vue +++ b/src/components/spray/trayGraph/index.vue @@ -62,6 +62,12 @@ const addSelect = () => { height: (75 - 15 * 2) * zoom, fill: 'rgba(238,10,36, 0.2)', draggable: true, + dragBoundFunc(pos) { + return { + x: 0, // X坐标保持不变 + y: pos.y, // 允许Y坐标变化 + } + }, }) // 在onMounted中rect创建后添加拖拽监听