From db60915de609a886f96900683173ef2aadd432b8 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 1 May 2025 12:07:01 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E3=80=91=E5=BA=97=E9=93=BA=E8=A3=85=E4=BF=AE-=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E6=A0=8F=EF=BC=9A=E4=B9=8B=E5=89=8D=20bgImgUrl=20?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88=E5=BD=BB?= =?UTF-8?q?=E5=BA=95=E4=BF=AE=E5=A4=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../s-title-block/s-title-block.vue | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/sheep/components/s-title-block/s-title-block.vue b/sheep/components/s-title-block/s-title-block.vue index 3668006..1f39f01 100644 --- a/sheep/components/s-title-block/s-title-block.vue +++ b/sheep/components/s-title-block/s-title-block.vue @@ -3,15 +3,15 @@ {{ data.title }} - {{ - data.description - }} + + {{ data.description }} + ({}), + default() {}, }, - // 装修样式 styles: { type: Object, - default: () => ({}), + default() {}, }, }); - // 设置背景样式 - const bgStyle = computed(() => { - // 直接从 props.styles 解构 - const { bgType, bgImg, bgColor } = props.styles; - // 根据 bgType 返回相应的样式 - return { - background: bgType === 'img' ? `url(${bgImg}) no-repeat top center / 100% 100%` : bgColor, - }; - }); + // 组件样式 + const elStyles = { + background: `url(${sheep.$url.cdn(props.data.bgImgUrl)}) no-repeat top center / 100% auto`, + fontSize: `${props.data.titleSize}px`, + fontWeight: `${props.data.titleWeight}`, + // add by 芋艿:shopro 是在 props.styles.height,我们是在 props.data.height + height: `${props.data.height || 40}px`, + }; // 标题样式 const titleStyles = { color: props.data.titleColor, fontSize: `${props.data.titleSize}px`, textAlign: props.data.textAlign, - marginLeft: `${props.data.skew || 0}px`, + // add by 芋艿:shopro 是在 props.data.skew,我们是在 props.data.marginLeft + marginLeft: `${props.data.marginLeft || 0}px`, }; // 副标题 @@ -78,8 +76,8 @@ color: props.data.descriptionColor, textAlign: props.data.textAlign, fontSize: `${props.data.descriptionSize}px`, - fontWeight: `${props.data.descriptionWeight}`, - marginLeft: `${props.data.skew || 0}px`, + fontWeight: `${props.data.descriptionWeight}px`, + marginLeft: `${props.data.marginLeft || 0}px`, };