diff --git a/sheep/components/s-title-block/s-title-block.vue b/sheep/components/s-title-block/s-title-block.vue index 36680061..1f39f01b 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`, };