From f18c05519d0fb05caafa72ea5ee2afe6921487a2 Mon Sep 17 00:00:00 2001 From: tnt group Date: Wed, 28 Sep 2022 22:16:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=A2=84=E8=A7=88=E7=8A=B6=E6=80=81=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/preview/components/PreviewRenderGroup/index.vue | 1 + src/views/preview/components/PreviewRenderList/index.vue | 1 + 2 files changed, 2 insertions(+) diff --git a/src/views/preview/components/PreviewRenderGroup/index.vue b/src/views/preview/components/PreviewRenderGroup/index.vue index d5bdf767..4d0a813e 100644 --- a/src/views/preview/components/PreviewRenderGroup/index.vue +++ b/src/views/preview/components/PreviewRenderGroup/index.vue @@ -9,6 +9,7 @@ ...getFilterStyle(item.styles), ...getTransformStyle(item.styles) }" + v-show="!item.status.hide" > Date: Thu, 29 Sep 2022 11:35:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=8B=E6=8E=A7=E5=88=B6=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../preview/components/PreviewRenderGroup/index.vue | 6 +++--- .../preview/components/PreviewRenderList/index.vue | 6 +++--- src/views/preview/utils/style.ts | 13 ++++++++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/views/preview/components/PreviewRenderGroup/index.vue b/src/views/preview/components/PreviewRenderGroup/index.vue index 4d0a813e..62b9b22a 100644 --- a/src/views/preview/components/PreviewRenderGroup/index.vue +++ b/src/views/preview/components/PreviewRenderGroup/index.vue @@ -7,9 +7,9 @@ :style="{ ...getComponentAttrStyle(item.attr, groupIndex), ...getFilterStyle(item.styles), - ...getTransformStyle(item.styles) + ...getTransformStyle(item.styles), + ...getStatusStyle(item.status) }" - v-show="!item.status.hide" > -type StylesType = PickCreateComponentType<'styles'> +type StatusType = PickCreateComponentType<'status'> // 设置位置 export const getComponentAttrStyle = (attr: AttrType, index: number) => { @@ -16,10 +16,17 @@ export const getComponentAttrStyle = (attr: AttrType, index: number) => { // 设置大小 export const getSizeStyle = (attr: AttrType, scale?: number) => { - return ({ + return { width: `${scale ? scale * attr.w : attr.w}px`, height: `${scale ? scale * attr.h : attr.h}px` - }) + } +} + +// 设置状态样式 +export const getStatusStyle = (attr: StatusType) => { + return { + display: attr.hide ? 'none' : 'block' + } } // 全局样式