【功能修复】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> <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 class="title-content">
<!-- 主标题 --> <!-- 主标题 -->
<view v-if="data.title" class="title-text" :style="[titleStyles]">{{ data.title }}</view> <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>
<!-- 查看更多 --> <!-- 查看更多 -->
<view v-if="data.more?.show" class="more-box ss-flex ss-col-center" @tap="sheep.$router.go(data.more.url)" <view
:style="{color: data.descriptionColor}"> 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> <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> <text class="_icon-forward" v-if="data.more.type !== 'text'"></text>
</view> </view>
@ -20,10 +30,7 @@
/** /**
* 标题栏 * 标题栏
*/ */
import { import { reactive, computed } from 'vue';
reactive,
computed
} from 'vue';
import sheep from '@/sheep'; import sheep from '@/sheep';
// //
@ -50,15 +57,11 @@
// //
const bgStyle = computed(() => { const bgStyle = computed(() => {
// props.styles // props.styles
const { const { bgType, bgImg, bgColor } = props.styles;
bgType,
bgImg,
bgColor
} = props.styles;
// bgType // bgType
return { 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 = { const titleStyles = {
color: props.data.titleColor, color: props.data.titleColor,
fontSize: `${props.data.titleSize}px`, fontSize: `${props.data.titleSize}px`,
textAlign: props.data.textAlign textAlign: props.data.textAlign,
}; };
// //
@ -74,7 +77,7 @@
color: props.data.descriptionColor, color: props.data.descriptionColor,
textAlign: props.data.textAlign, textAlign: props.data.textAlign,
fontSize: `${props.data.descriptionSize}px`, fontSize: `${props.data.descriptionSize}px`,
fontWeight: `${props.data.descriptionWeight}px`, fontWeight: `${props.data.descriptionWeight}`,
}; };
</script> </script>