Files
admin/www/app/components/section/layouts/LayoutFeatureGrid.vue
T

45 lines
1.9 KiB
Vue
Raw Normal View History

2026-07-31 19:02:00 +08:00
<script setup lang="ts">
import type { SectionBlock } from '~/types/site';
const props = defineProps<{ section: SectionBlock }>();
2026-08-03 19:09:03 +08:00
const { overline, title, subtitle, config, isEn, isDark, overlineStyle, titleStyle, bodyStyle } = useSectionContent(props.section);
2026-07-31 19:02:00 +08:00
const features = computed(() => config.value.features ?? []);
</script>
<template>
2026-08-05 18:36:01 +08:00
<div class="section-container py-[var(--sec-py,96px)]">
2026-07-31 19:02:00 +08:00
<!-- 标题区 -->
<div class="text-center max-w-640px mx-auto mb-56px">
2026-08-04 19:18:35 +08:00
<p v-if="overline" class="text-14px font-semibold tracking-widest uppercase" :class="isDark ? 'text-primary-300' : 'text-primary'" :style="overlineStyle">
2026-07-31 19:02:00 +08:00
{{ overline }}
</p>
2026-08-05 18:36:01 +08:00
<h2 class="mt-12px font-bold" :class="isDark ? 'text-white' : 'text-gray-900 dark:text-white'" :style="titleStyle">
2026-07-31 19:02:00 +08:00
{{ title }}
</h2>
2026-08-03 19:09:03 +08:00
<p v-if="subtitle" class="mt-16px text-base" :class="isDark ? 'text-gray-400' : 'text-gray-500 dark:text-gray-400'" :style="bodyStyle">
2026-07-31 19:02:00 +08:00
{{ subtitle }}
</p>
</div>
<!-- 特性网格 -->
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-24px">
<div
v-for="(feature, idx) in features"
:key="idx"
class="p-32px rounded-16px transition-all hover:-translate-y-4px"
:class="isDark ? 'bg-white/5 border border-white/10' : 'bg-white border border-gray-100 shadow-sm hover:shadow-md dark:bg-dark-800 dark:border-dark-700'"
>
<span v-if="feature.icon" class="text-3xl">{{ feature.icon }}</span>
2026-08-03 19:09:03 +08:00
<h3 class="mt-16px text-lg font-semibold" :class="isDark ? 'text-white' : 'text-gray-900 dark:text-white'" :style="titleStyle">
2026-07-31 19:02:00 +08:00
{{ isEn ? feature.title_en : feature.title_zh }}
</h3>
2026-08-03 19:09:03 +08:00
<p class="mt-8px text-sm leading-relaxed" :class="isDark ? 'text-gray-400' : 'text-gray-500 dark:text-gray-400'" :style="bodyStyle">
2026-07-31 19:02:00 +08:00
{{ isEn ? feature.desc_en : feature.desc_zh }}
</p>
</div>
</div>
</div>
</template>