【功能修复】s-title-block 的 fontWeight 多加了 px 像素
parent
f36b183407
commit
4bdc82786e
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue