diff --git a/frontend/src/components/canvas/CanvasStage.vue b/frontend/src/components/canvas/CanvasStage.vue index 056386f..25d00b7 100644 --- a/frontend/src/components/canvas/CanvasStage.vue +++ b/frontend/src/components/canvas/CanvasStage.vue @@ -216,6 +216,7 @@ function onPointerDown(e) { // 2) 点击连线:切换选中(不再落入平移) const edgeHit = e.target.closest?.('.cv-edge-hit') if (edgeHit && e.button === 0) { + linkSource.value = null const id = edgeHit.dataset.edgeId const s = new Set(edgeSel.value) if (s.has(id)) s.delete(id) @@ -226,7 +227,7 @@ function onPointerDown(e) { } const node = hitNode(e) - if (!node) linkSource.value = null + if (!node || node.id === linkSource.value?.id) linkSource.value = null const p = localXY(e) const wantPan = @@ -355,7 +356,7 @@ function onPortClick(id, side) { return } if (linkSource.value.id === id) { - linkSource.value = linkSource.value.side === side ? null : { id, side } + linkSource.value = null return } emit('link-create', { @@ -570,7 +571,7 @@ defineExpose({
-