新版官网模板

This commit is contained in:
2026-04-29 01:33:33 +08:00
commit 0d82386f8f
341 changed files with 64526 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
<template>
<div :class="{ 'has-image': showImage && article.image }" class="article-item">
<NuxtLink :to="article.link || `/article/${article.id}`" class="article-link">
<div class="article-content">
<div class="article-title">{{ article.title }}</div>
<div class="article-meta">
<span v-if="article.source" class="source">{{ article.source }}</span>
<span class="date">{{ article.date }}</span>
</div>
</div>
<img v-if="showImage && article.image" :alt="article.title" :src="article.image" class="article-image" />
</NuxtLink>
</div>
</template>
<script lang="ts" setup>
interface Article {
id: number
title: string
date: string
source?: string
image?: string
link?: string
}
defineProps<{
article: Article
showImage?: boolean
}>()
</script>
<style scoped>
.article-item {
padding: 10px 0;
border-bottom: 1px dashed #eee;
}
.article-item:last-child {
border-bottom: none;
}
.article-link {
display: flex;
align-items: flex-start;
gap: 12px;
text-decoration: none;
color: inherit;
}
.article-content {
flex: 1;
min-width: 0;
}
.article-title {
font-size: 14px;
color: #333;
line-height: 1.5;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
transition: color 0.2s;
}
.article-link:hover .article-title {
color: #1e3a5f;
}
.article-meta {
display: flex;
align-items: center;
gap: 12px;
margin-top: 6px;
font-size: 12px;
color: #999;
}
.source {
color: #e74c3c;
}
.article-image {
width: 100px;
height: 70px;
object-fit: cover;
border-radius: 4px;
flex-shrink: 0;
}
.has-image .article-title {
-webkit-line-clamp: 1;
}
@media (max-width: 576px) {
.article-image {
width: 80px;
height: 56px;
}
}
</style>

View File

@@ -0,0 +1,58 @@
<template>
<div class="section-header">
<div class="header-left">
<span class="icon">{{ icon }}</span>
<h2 class="title">{{ title }}</h2>
</div>
<NuxtLink v-if="moreLink" :to="moreLink" class="more-link">
查看更多
</NuxtLink>
</div>
</template>
<script lang="ts" setup>
defineProps<{
title: string
icon?: string
moreLink?: string
}>()
</script>
<style scoped>
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24px;
padding-bottom: 16px;
border-bottom: 3px solid #1e3a5f;
}
.header-left {
display: flex;
align-items: center;
gap: 12px;
}
.icon {
font-size: 24px;
}
.title {
font-size: 22px;
font-weight: 700;
color: #1e3a5f;
margin: 0;
}
.more-link {
color: #666;
font-size: 14px;
text-decoration: none;
transition: color 0.2s;
}
.more-link:hover {
color: #1e3a5f;
}
</style>