From 06e54ae1323791fcff03626fcc4e645b8d98e892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Sat, 8 Jul 2023 21:33:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=98=E5=8E=9F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=88=90=E7=BB=84=E6=97=8B=E8=BD=AC=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E9=A2=84=E8=A7=88=E6=94=BE=E5=A4=A7?= =?UTF-8?q?=E7=9A=84=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/preview/components/PreviewRenderGroup/index.vue | 5 ++++- src/views/preview/hooks/useScale.hook.ts | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/preview/components/PreviewRenderGroup/index.vue b/src/views/preview/components/PreviewRenderGroup/index.vue index fd7b04c3..354fa29c 100644 --- a/src/views/preview/components/PreviewRenderGroup/index.vue +++ b/src/views/preview/components/PreviewRenderGroup/index.vue @@ -46,11 +46,14 @@ const props = defineProps({ required: true }, groupIndex: { - type: [String, Number], + type: Number, required: true } }) diff --git a/src/views/preview/hooks/useScale.hook.ts b/src/views/preview/hooks/useScale.hook.ts index b0185383..e4c57f97 100644 --- a/src/views/preview/hooks/useScale.hook.ts +++ b/src/views/preview/hooks/useScale.hook.ts @@ -23,6 +23,8 @@ export const useScale = (localStorageInfo: ChartEditStorageType) => { e.preventDefault() e.stopPropagation() removeEvent() + const fitDom = document.querySelector(".go-preview.fit") as HTMLElement + if (fitDom) fitDom.style.overflow = 'auto' const transform = previewRef.value.style.transform // 使用正则解析 scale(1, 1) 中的两个数值 const regRes = transform.match(/scale\((\d+\.?\d*)*/) as RegExpMatchArray