From e129a48ccafc59b430ee9e04975eb3832a9cd7c2 Mon Sep 17 00:00:00 2001 From: allenve Date: Tue, 24 Dec 2024 17:44:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mobileTool=E6=94=AF=E6=8C=81=E9=85=8D?= =?UTF-8?q?=E7=BD=AEborder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-ui/src/components/MobileDevTool.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/amis-ui/src/components/MobileDevTool.tsx b/packages/amis-ui/src/components/MobileDevTool.tsx index 9937845df63..1ccb3c013d5 100644 --- a/packages/amis-ui/src/components/MobileDevTool.tsx +++ b/packages/amis-ui/src/components/MobileDevTool.tsx @@ -102,6 +102,7 @@ const scaleList = [50, 75, 100, 125, 150, 200]; export default function MobileDevTool(props: { container: HTMLElement | null; previewBody: HTMLElement | null; + border?: number; }) { const [dimension, setDimension] = React.useState( () => @@ -232,9 +233,10 @@ export default function MobileDevTool(props: { function updatePreviewSize(dimension: {width: number; height: number}) { if (previewBody) { + const {border = 20} = props; // 预览区域宽高加上20px的padding - previewBody.style.width = dimension.width + 20 + 'px'; - previewBody.style.height = dimension.height + 20 + 'px'; + previewBody.style.width = dimension.width + border + 'px'; + previewBody.style.height = dimension.height + border + 'px'; } }