fix: timeline ui 重构

This commit is contained in:
tim
2025-09-19 16:21:19 +08:00
parent 4cc108094d
commit a9d8181940
3 changed files with 26 additions and 36 deletions

View File

@@ -95,7 +95,7 @@ export default {
} }
.timeline-item:last-child::before { .timeline-item:last-child::before {
display: none; bottom: 0px;
} }
.timeline-content { .timeline-content {

View File

@@ -1,26 +1,16 @@
<template> <template>
<div class="timeline-tag-item"> <div class="timeline-tag-item">
<template v-if="mode === 'timeline'"> <div class="tags-container">
<div class="tags-container"> <div class="tags-container-item">
<div class="tags-container-item"> <div class="timeline-tag-title">创建了标签</div>
<div class="timeline-tag-title">{{ title }}</div> <ArticleTags v-if="tag" :tags="[tag]" />
<ArticleTags v-if="tag" :tags="[tag]" /> <span class="timeline-tag-count" v-if="tag?.count"> x{{ tag.count }}</span>
</div>
<div v-if="timelineDate" class="timeline-date">{{ timelineDate }}</div>
</div> </div>
<div v-if="hasDescription" class="timeline-snippet"> <div v-if="timelineDate" class="timeline-date">{{ timelineDate }}</div>
{{ tag?.description }} </div>
</div> <div v-if="hasDescription" class="timeline-snippet">
</template> {{ tag?.description }}
<template v-else> </div>
<span class="timeline-link" :class="{ clickable: isClickable }" @click="handleTagClick">
{{ tag?.name }}<span v-if="tag?.count"> x{{ tag.count }}</span>
</span>
<div v-if="hasDescription" class="timeline-snippet">
{{ tag?.description }}
</div>
<div v-if="summaryDate" class="timeline-date">{{ summaryDate }}</div>
</template>
</div> </div>
</template> </template>
@@ -30,15 +20,6 @@ import TimeManager from '~/utils/time'
const props = defineProps({ const props = defineProps({
item: { type: Object, required: true }, item: { type: Object, required: true },
mode: {
type: String,
default: 'timeline',
validator: (value) => ['timeline', 'summary'].includes(value),
},
title: {
type: String,
default: '创建了标签',
},
}) })
const emit = defineEmits(['tag-click']) const emit = defineEmits(['tag-click'])
@@ -95,6 +76,10 @@ const handleTagClick = () => {
font-weight: 600; font-weight: 600;
} }
.timeline-tag-count {
font-size: 12px;
}
.timeline-date { .timeline-date {
font-size: 12px; font-size: 12px;
color: gray; color: gray;

View File

@@ -112,19 +112,18 @@
{{ item.comment.post.title }} {{ item.comment.post.title }}
</NuxtLink> </NuxtLink>
<template v-if="item.comment.parentComment"> <template v-if="item.comment.parentComment">
下对
<NuxtLink <NuxtLink
:to="`/posts/${item.comment.post.id}#comment-${item.comment.parentComment.id}`" :to="`/posts/${item.comment.post.id}#comment-${item.comment.parentComment.id}`"
class="timeline-link" class="timeline-comment-link"
> >
{{ stripMarkdownLength(item.comment.parentComment.content, 200) }} {{ stripMarkdownLength(item.comment.parentComment.content, 200) }}
</NuxtLink> </NuxtLink>
回复了 <next class="reply-icon" /> 回复了
</template> </template>
<template v-else> 下评论了 </template> <template v-else> 下评论了 </template>
<NuxtLink <NuxtLink
:to="`/posts/${item.comment.post.id}#comment-${item.comment.id}`" :to="`/posts/${item.comment.post.id}#comment-${item.comment.id}`"
class="timeline-link" class="timeline-comment-link"
> >
{{ stripMarkdownLength(item.comment.content, 200) }} {{ stripMarkdownLength(item.comment.content, 200) }}
</NuxtLink> </NuxtLink>
@@ -156,7 +155,7 @@
<div class="summary-content" v-if="hotTags.length > 0"> <div class="summary-content" v-if="hotTags.length > 0">
<BaseTimeline :items="hotTags"> <BaseTimeline :items="hotTags">
<template #item="{ item }"> <template #item="{ item }">
<TimelineTagItem :item="item" mode="summary" @tag-click="gotoTag" /> <TimelineTagItem :item="item" />
</template> </template>
</BaseTimeline> </BaseTimeline>
</div> </div>
@@ -670,6 +669,11 @@ watch(selectedTab, async (val) => {
color: #666; color: #666;
} }
.reply-icon {
color: var(--primary-color);
margin-left: 5px;
}
.profile-page-header-user-info-buttons { .profile-page-header-user-info-buttons {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@@ -922,8 +926,8 @@ watch(selectedTab, async (val) => {
.timeline-link { .timeline-link {
font-weight: bold; font-weight: bold;
color: var(--primary-color);
text-decoration: none; text-decoration: none;
color: var(--text-color);
word-break: break-word; word-break: break-word;
} }
@@ -1014,6 +1018,7 @@ watch(selectedTab, async (val) => {
color: var(--text-color); color: var(--text-color);
word-break: break-word; word-break: break-word;
text-decoration: underline; text-decoration: underline;
margin-left: 5px;
} }
.timeline-comment-link:hover { .timeline-comment-link:hover {