56 lines
1016 B
Vue
56 lines
1016 B
Vue
<template>
|
|
<article class="news-item">
|
|
<div class="meta">
|
|
<span>{{ item.source }} {{ item.time }}</span>
|
|
<a v-if="item.url" :href="item.url" target="_blank" rel="noopener">查看原文 ></a>
|
|
</div>
|
|
<h3 class="title">{{ item.title }}</h3>
|
|
<p class="summary">{{ item.summary }}</p>
|
|
</article>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import type { NewsItem } from '../../types'
|
|
|
|
defineProps<{
|
|
item: NewsItem
|
|
}>()
|
|
</script>
|
|
|
|
<style scoped>
|
|
.news-item {
|
|
padding: 14px 0;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
|
|
.news-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.meta {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
color: var(--text-secondary);
|
|
font-size: 12px;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.title {
|
|
margin: 0 0 6px;
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.summary {
|
|
margin: 0;
|
|
color: #5c6570;
|
|
font-size: 13px;
|
|
line-height: 1.6;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 3;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
}
|
|
</style>
|