【功能修复】s-title-block 的 fontWeight 多加了 px 像素

pull/124/head^2
YunaiV 2024-10-27 18:22:47 +08:00
parent f36b183407
commit 4bdc82786e
1 changed files with 95 additions and 92 deletions

View File

@ -1,15 +1,25 @@
<!-- 装修商品组件标题栏 -->
<template>
<view class="ss-title-wrap ss-flex ss-col-center" :class="[state.typeMap[data.textAlign]]" :style="[bgStyle, { marginLeft: `${data.space}px` }]">
<view
class="ss-title-wrap ss-flex ss-col-center"
:class="[state.typeMap[data.textAlign]]"
:style="[bgStyle, { marginLeft: `${data.space}px` }]"
>
<view class="title-content">
<!-- 主标题 -->
<view v-if="data.title" class="title-text" :style="[titleStyles]">{{ data.title }}</view>
<!-- 副标题 -->
<view v-if="data.description" :style="[descStyles]" class="sub-title-text">{{ data.description }}</view>
<view v-if="data.description" :style="[descStyles]" class="sub-title-text">{{
data.description
}}</view>
</view>
<!-- 查看更多 -->
<view v-if="data.more?.show" class="more-box ss-flex ss-col-center" @tap="sheep.$router.go(data.more.url)"
:style="{color: data.descriptionColor}">
<view
v-if="data.more?.show"
class="more-box ss-flex ss-col-center"
@tap="sheep.$router.go(data.more.url)"
:style="{ color: data.descriptionColor }"
>
<view class="more-text" v-if="data.more.type !== 'icon'">{{ data.more.text }} </view>
<text class="_icon-forward" v-if="data.more.type !== 'text'"></text>
</view>
@ -20,10 +30,7 @@
/**
* 标题栏
*/
import {
reactive,
computed
} from 'vue';
import { reactive, computed } from 'vue';
import sheep from '@/sheep';
//
@ -50,15 +57,11 @@
//
const bgStyle = computed(() => {
// props.styles
const {
bgType,
bgImg,
bgColor
} = props.styles;
const { bgType, bgImg, bgColor } = props.styles;
// bgType
return {
background: bgType === 'img' ? `url(${bgImg}) no-repeat top center / 100% 100%` : bgColor
background: bgType === 'img' ? `url(${bgImg}) no-repeat top center / 100% 100%` : bgColor,
};
});
@ -66,7 +69,7 @@
const titleStyles = {
color: props.data.titleColor,
fontSize: `${props.data.titleSize}px`,
textAlign: props.data.textAlign
textAlign: props.data.textAlign,
};
//
@ -74,7 +77,7 @@
color: props.data.descriptionColor,
textAlign: props.data.textAlign,
fontSize: `${props.data.descriptionSize}px`,
fontWeight: `${props.data.descriptionWeight}px`,
fontWeight: `${props.data.descriptionWeight}`,
};
</script>