diff --git a/AutoRobot/Windows/Robot/Web/src/DockLayout/Panel.vue b/AutoRobot/Windows/Robot/Web/src/DockLayout/Panel.vue index f92daab..8eab222 100644 --- a/AutoRobot/Windows/Robot/Web/src/DockLayout/Panel.vue +++ b/AutoRobot/Windows/Robot/Web/src/DockLayout/Panel.vue @@ -470,6 +470,10 @@ const onResizeStart = (e, direction) => { height: currentPosition.y - startPosition.y }; + // 定义最小尺寸常量 + const minWidth = 200; + const minHeight = 30; + // 根据方向正确计算新尺寸 let newWidth = areaStartState.width; let newHeight = areaStartState.height; @@ -492,6 +496,12 @@ const onResizeStart = (e, direction) => { newHeight = areaStartState.height + totalDelta.height; } + // 检查尺寸是否小于最小值,如果小于则不发送事件 + if (newWidth < minWidth || newHeight < minHeight) { + // 尺寸小于最小值,不发送事件,停止拖拽 + return; + } + const newSize = { width: newWidth, height: newHeight