hulai-website/components/common/SectionTitle.vue
Mimingguang ee078b61bc feat: 后台管理系统完整重构 + 前后台数据联通
- 后台全面引入 Naive UI 组件库,统一 UI 规范
- 前台 usePublicApi 切换到 API 调用(GET /api/content/[key])
- 前后台数据源统一(site_content 表)
- 产品线统一管理(tour/camp/course 三套编辑器)
- 产品数据归一化(itinerary/faq/pricing 格式统一)
- 表单提交 API 改写入 submissions 表
- 新增 submissions 标记已读 API
- site-content PUT 支持 upsert
- 修复前台 bug(stories 路由冲突、占位符警告、selector breadcrumb)
- 消除 PageHero 类型警告(useSEO reactive 修复)
- 25 个前台页面全部 HTTP 200,展示效果不变

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:48:02 +08:00

77 行
1.6 KiB
Vue

<template>
<div class="section-title" :class="[`section-title--${align}`]">
<span v-if="label" class="section-title-label">{{ label }}</span>
<component :is="tag" class="section-title-text">{{ title }}</component>
<p v-if="subtitle" class="section-title-sub">{{ subtitle }}</p>
</div>
</template>
<script setup>
defineProps({
title: { type: String, required: true },
subtitle: { type: String, default: '' },
label: { type: String, default: '' },
tag: { type: String, default: 'h2' },
align: { type: String, default: 'center' },
})
</script>
<style lang="less" scoped>
.section-title {
margin-bottom: @space-xl;
.respond-md({
margin-bottom: @space-2xl;
});
&--center {
text-align: center;
}
&--left {
text-align: left;
}
}
.section-title-label {
display: inline-block;
font-size: @font-size-xs;
font-weight: @font-weight-bold;
color: @color-primary;
text-transform: uppercase;
letter-spacing: 3px;
margin-bottom: @space-sm;
opacity: 0.7;
}
.section-title-text {
color: @color-text-primary;
// 标题下方品牌色渐变短线装饰(加宽加圆润)
&::after {
content: '';
display: block;
width: 64px;
height: 3px;
background: @gradient-accent;
border-radius: 3px;
margin-top: @space-md;
}
.section-title--center & {
&::after {
margin-left: auto;
margin-right: auto;
}
}
}
.section-title-sub {
margin-top: @space-md;
font-size: @font-size-md;
color: @color-text-muted;
line-height: @line-height-relaxed;
letter-spacing: 0.3px;
}
</style>