39 lines
1.5 KiB
Vue
39 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import type { SectionBlock } from '~/types/site';
|
|
|
|
const props = defineProps<{ section: SectionBlock }>();
|
|
|
|
const { overline, title, subtitle, config, isEn, isDark } = useSectionContent(props.section);
|
|
|
|
const stats = computed(() => config.value.stats ?? []);
|
|
</script>
|
|
|
|
<template>
|
|
<div class="section-container py-96px">
|
|
<!-- 标题区 -->
|
|
<div class="text-center max-w-640px mx-auto mb-64px">
|
|
<p v-if="overline" class="text-13px font-semibold tracking-widest uppercase" :class="isDark ? 'text-primary-300' : 'text-primary'">
|
|
{{ overline }}
|
|
</p>
|
|
<h2 class="mt-12px text-3xl md:text-4xl font-bold" :class="isDark ? 'text-white' : 'text-gray-900 dark:text-white'">
|
|
{{ title }}
|
|
</h2>
|
|
<p v-if="subtitle" class="mt-16px text-base" :class="isDark ? 'text-gray-400' : 'text-gray-500 dark:text-gray-400'">
|
|
{{ subtitle }}
|
|
</p>
|
|
</div>
|
|
|
|
<!-- 数据统计 -->
|
|
<div class="grid grid-cols-2 lg:grid-cols-4 gap-32px">
|
|
<div v-for="(stat, idx) in stats" :key="idx" class="flex-col-center text-center">
|
|
<p class="text-4xl md:text-5xl font-bold" :class="isDark ? 'text-white' : 'text-gray-900 dark:text-white'">
|
|
{{ stat.value }}<span class="text-2xl md:text-3xl ml-4px opacity-70">{{ stat.unit }}</span>
|
|
</p>
|
|
<p class="mt-12px text-sm" :class="isDark ? 'text-gray-400' : 'text-gray-500 dark:text-gray-400'">
|
|
{{ isEn ? stat.label_en : stat.label_zh }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|