Merge pull request #619 from nagisa77/feature/remove-router-link

fix: router-link
This commit is contained in:
Tim
2025-08-18 11:17:14 +08:00
committed by GitHub
5 changed files with 103 additions and 103 deletions

View File

@@ -16,11 +16,11 @@
<div class="info-content-header-left"> <div class="info-content-header-left">
<span class="user-name">{{ comment.userName }}</span> <span class="user-name">{{ comment.userName }}</span>
<i class="fas fa-medal medal-icon"></i> <i class="fas fa-medal medal-icon"></i>
<router-link <NuxtLink
v-if="comment.medal" v-if="comment.medal"
class="medal-name" class="medal-name"
:to="`/users/${comment.userId}?tab=achievements`" :to="`/users/${comment.userId}?tab=achievements`"
>{{ getMedalTitle(comment.medal) }}</router-link >{{ getMedalTitle(comment.medal) }}</NuxtLink
> >
<i v-if="comment.pinned" class="fas fa-thumbtack pin-icon"></i> <i v-if="comment.pinned" class="fas fa-thumbtack pin-icon"></i>
<span v-if="level >= 2"> <span v-if="level >= 2">

View File

@@ -2,7 +2,7 @@
<div class="not-found-page"> <div class="not-found-page">
<h1>404 - 页面不存在</h1> <h1>404 - 页面不存在</h1>
<p>你访问的页面不存在或已被删除</p> <p>你访问的页面不存在或已被删除</p>
<router-link to="/">返回首页</router-link> <NuxtLink to="/">返回首页</NuxtLink>
</div> </div>
</template> </template>

View File

@@ -66,61 +66,61 @@
<span class="notif-type"> <span class="notif-type">
<template v-if="item.type === 'COMMENT_REPLY' && item.parentComment"> <template v-if="item.type === 'COMMENT_REPLY' && item.parentComment">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.comment.author.id}`" :to="`/users/${item.comment.author.id}`"
>{{ item.comment.author.username }} >{{ item.comment.author.username }}
</router-link> </NuxtLink>
对我的评论 对我的评论
<span> <span>
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}#comment-${item.parentComment.id}`" :to="`/posts/${item.post.id}#comment-${item.parentComment.id}`"
> >
{{ stripMarkdownLength(item.parentComment.content, 100) }} {{ stripMarkdownLength(item.parentComment.content, 100) }}
</router-link> </NuxtLink>
</span> </span>
回复了 回复了
<span> <span>
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}#comment-${item.comment.id}`" :to="`/posts/${item.post.id}#comment-${item.comment.id}`"
> >
{{ stripMarkdownLength(item.comment.content, 100) }} {{ stripMarkdownLength(item.comment.content, 100) }}
</router-link> </NuxtLink>
</span> </span>
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'COMMENT_REPLY' && !item.parentComment"> <template v-else-if="item.type === 'COMMENT_REPLY' && !item.parentComment">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.comment.author.id}`" :to="`/users/${item.comment.author.id}`"
>{{ item.comment.author.username }} >{{ item.comment.author.username }}
</router-link> </NuxtLink>
对我的文章 对我的文章
<span> <span>
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
</span> </span>
回复了 回复了
<span> <span>
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}#comment-${item.comment.id}`" :to="`/posts/${item.post.id}#comment-${item.comment.id}`"
> >
{{ stripMarkdownLength(item.comment.content, 100) }} {{ stripMarkdownLength(item.comment.content, 100) }}
</router-link> </NuxtLink>
</span> </span>
</NotificationContainer> </NotificationContainer>
</template> </template>
@@ -140,310 +140,310 @@
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<span class="notif-user">{{ item.fromUser.username }} </span> 对我的文章 <span class="notif-user">{{ item.fromUser.username }} </span> 对我的文章
<span> <span>
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
</span> </span>
进行了表态 进行了表态
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'REACTION' && item.comment"> <template v-else-if="item.type === 'REACTION' && item.comment">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
>{{ item.fromUser.username }} >{{ item.fromUser.username }}
</router-link> </NuxtLink>
对我的评论 对我的评论
<span> <span>
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}#comment-${item.comment.id}`" :to="`/posts/${item.post.id}#comment-${item.comment.id}`"
> >
{{ stripMarkdownLength(item.comment.content, 100) }} {{ stripMarkdownLength(item.comment.content, 100) }}
</router-link> </NuxtLink>
</span> </span>
进行了表态 进行了表态
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'POST_VIEWED'"> <template v-else-if="item.type === 'POST_VIEWED'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
> >
{{ item.fromUser.username }} {{ item.fromUser.username }}
</router-link> </NuxtLink>
查看了您的帖子 查看了您的帖子
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'LOTTERY_WIN'"> <template v-else-if="item.type === 'LOTTERY_WIN'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
恭喜你在抽奖贴 恭喜你在抽奖贴
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
中获奖 中获奖
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'LOTTERY_DRAW'"> <template v-else-if="item.type === 'LOTTERY_DRAW'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
您的抽奖贴 您的抽奖贴
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
已开奖 已开奖
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'POST_UPDATED'"> <template v-else-if="item.type === 'POST_UPDATED'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
您关注的帖子 您关注的帖子
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
下面有新评论 下面有新评论
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}#comment-${item.comment.id}`" :to="`/posts/${item.post.id}#comment-${item.comment.id}`"
> >
{{ stripMarkdownLength(item.comment.content, 100) }} {{ stripMarkdownLength(item.comment.content, 100) }}
</router-link> </NuxtLink>
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'USER_ACTIVITY' && item.parentComment"> <template v-else-if="item.type === 'USER_ACTIVITY' && item.parentComment">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
你关注的 你关注的
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.comment.author.id}`" :to="`/users/${item.comment.author.id}`"
> >
{{ item.comment.author.username }} {{ item.comment.author.username }}
</router-link> </NuxtLink>
对评论 对评论
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}#comment-${item.parentComment.id}`" :to="`/posts/${item.post.id}#comment-${item.parentComment.id}`"
> >
{{ stripMarkdownLength(item.parentComment.content, 100) }} {{ stripMarkdownLength(item.parentComment.content, 100) }}
</router-link> </NuxtLink>
回复了 回复了
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}#comment-${item.comment.id}`" :to="`/posts/${item.post.id}#comment-${item.comment.id}`"
> >
{{ stripMarkdownLength(item.comment.content, 100) }} {{ stripMarkdownLength(item.comment.content, 100) }}
</router-link> </NuxtLink>
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'USER_ACTIVITY'"> <template v-else-if="item.type === 'USER_ACTIVITY'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
你关注的 你关注的
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.comment.author.id}`" :to="`/users/${item.comment.author.id}`"
> >
{{ item.comment.author.username }} {{ item.comment.author.username }}
</router-link> </NuxtLink>
在文章 在文章
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
下面评论了 下面评论了
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}#comment-${item.comment.id}`" :to="`/posts/${item.post.id}#comment-${item.comment.id}`"
> >
{{ stripMarkdownLength(item.comment.content, 100) }} {{ stripMarkdownLength(item.comment.content, 100) }}
</router-link> </NuxtLink>
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'MENTION' && item.comment"> <template v-else-if="item.type === 'MENTION' && item.comment">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
> >
{{ item.fromUser.username }} {{ item.fromUser.username }}
</router-link> </NuxtLink>
在评论中提到了你 在评论中提到了你
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}#comment-${item.comment.id}`" :to="`/posts/${item.post.id}#comment-${item.comment.id}`"
> >
{{ stripMarkdownLength(item.comment.content, 100) }} {{ stripMarkdownLength(item.comment.content, 100) }}
</router-link> </NuxtLink>
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'MENTION'"> <template v-else-if="item.type === 'MENTION'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
> >
{{ item.fromUser.username }} {{ item.fromUser.username }}
</router-link> </NuxtLink>
在帖子 在帖子
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
中提到了你 中提到了你
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'USER_FOLLOWED'"> <template v-else-if="item.type === 'USER_FOLLOWED'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
> >
{{ item.fromUser.username }} {{ item.fromUser.username }}
</router-link> </NuxtLink>
开始关注你了 开始关注你了
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'USER_UNFOLLOWED'"> <template v-else-if="item.type === 'USER_UNFOLLOWED'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
> >
{{ item.fromUser.username }} {{ item.fromUser.username }}
</router-link> </NuxtLink>
取消关注你了 取消关注你了
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'FOLLOWED_POST'"> <template v-else-if="item.type === 'FOLLOWED_POST'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
你关注的 你关注的
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
> >
{{ item.fromUser.username }} {{ item.fromUser.username }}
</router-link> </NuxtLink>
发布了文章 发布了文章
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'POST_SUBSCRIBED'"> <template v-else-if="item.type === 'POST_SUBSCRIBED'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
> >
{{ item.fromUser.username }} {{ item.fromUser.username }}
</router-link> </NuxtLink>
订阅了你的文章 订阅了你的文章
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'POST_UNSUBSCRIBED'"> <template v-else-if="item.type === 'POST_UNSUBSCRIBED'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
> >
{{ item.fromUser.username }} {{ item.fromUser.username }}
</router-link> </NuxtLink>
取消订阅了你的文章 取消订阅了你的文章
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'POST_REVIEW_REQUEST' && item.fromUser"> <template v-else-if="item.type === 'POST_REVIEW_REQUEST' && item.fromUser">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/users/${item.fromUser.id}`" :to="`/users/${item.fromUser.id}`"
> >
{{ item.fromUser.username }} {{ item.fromUser.username }}
</router-link> </NuxtLink>
发布了帖子 发布了帖子
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
请审核 请审核
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'POST_REVIEW_REQUEST'"> <template v-else-if="item.type === 'POST_REVIEW_REQUEST'">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
您发布的帖子 您发布的帖子
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
已提交审核 已提交审核
</NotificationContainer> </NotificationContainer>
</template> </template>
@@ -472,26 +472,26 @@
<template v-else-if="item.type === 'POST_REVIEWED' && item.approved"> <template v-else-if="item.type === 'POST_REVIEWED' && item.approved">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
您发布的帖子 您发布的帖子
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
已审核通过 已审核通过
</NotificationContainer> </NotificationContainer>
</template> </template>
<template v-else-if="item.type === 'POST_REVIEWED' && item.approved === false"> <template v-else-if="item.type === 'POST_REVIEWED' && item.approved === false">
<NotificationContainer :item="item" :markRead="markRead"> <NotificationContainer :item="item" :markRead="markRead">
您发布的帖子 您发布的帖子
<router-link <NuxtLink
class="notif-content-text" class="notif-content-text"
@click="markRead(item.id)" @click="markRead(item.id)"
:to="`/posts/${item.post.id}`" :to="`/posts/${item.post.id}`"
> >
{{ stripMarkdownLength(item.post.title, 100) }} {{ stripMarkdownLength(item.post.title, 100) }}
</router-link> </NuxtLink>
已被管理员拒绝 已被管理员拒绝
</NotificationContainer> </NotificationContainer>
</template> </template>

View File

@@ -52,11 +52,11 @@
<div class="user-name"> <div class="user-name">
{{ author.username }} {{ author.username }}
<i class="fas fa-medal medal-icon"></i> <i class="fas fa-medal medal-icon"></i>
<router-link <NuxtLink
v-if="author.displayMedal" v-if="author.displayMedal"
class="user-medal" class="user-medal"
:to="`/users/${author.id}?tab=achievements`" :to="`/users/${author.id}?tab=achievements`"
>{{ getMedalTitle(author.displayMedal) }}</router-link >{{ getMedalTitle(author.displayMedal) }}</NuxtLink
> >
</div> </div>
<div class="post-time">{{ postTime }}</div> <div class="post-time">{{ postTime }}</div>
@@ -68,11 +68,11 @@
<div class="user-name"> <div class="user-name">
{{ author.username }} {{ author.username }}
<i class="fas fa-medal medal-icon"></i> <i class="fas fa-medal medal-icon"></i>
<router-link <NuxtLink
v-if="author.displayMedal" v-if="author.displayMedal"
class="user-medal" class="user-medal"
:to="`/users/${author.id}?tab=achievements`" :to="`/users/${author.id}?tab=achievements`"
>{{ getMedalTitle(author.displayMedal) }}</router-link >{{ getMedalTitle(author.displayMedal) }}</NuxtLink
> >
</div> </div>
<div class="post-time">{{ postTime }}</div> <div class="post-time">{{ postTime }}</div>

View File

@@ -130,26 +130,26 @@
<BaseTimeline :items="hotReplies"> <BaseTimeline :items="hotReplies">
<template #item="{ item }"> <template #item="{ item }">
<router-link :to="`/posts/${item.comment.post.id}`" class="timeline-link"> <NuxtLink :to="`/posts/${item.comment.post.id}`" class="timeline-link">
{{ item.comment.post.title }} {{ item.comment.post.title }}
</router-link> </NuxtLink>
<template v-if="item.comment.parentComment"> <template v-if="item.comment.parentComment">
下对 下对
<router-link <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-link"
> >
{{ stripMarkdownLength(item.comment.parentComment.content, 200) }} {{ stripMarkdownLength(item.comment.parentComment.content, 200) }}
</router-link> </NuxtLink>
回复了 回复了
</template> </template>
<template v-else> 下评论了 </template> <template v-else> 下评论了 </template>
<router-link <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-link"
> >
{{ stripMarkdownLength(item.comment.content, 200) }} {{ stripMarkdownLength(item.comment.content, 200) }}
</router-link> </NuxtLink>
<div class="timeline-date"> <div class="timeline-date">
{{ formatDate(item.comment.createdAt) }} {{ formatDate(item.comment.createdAt) }}
</div> </div>
@@ -165,9 +165,9 @@
<div class="summary-content" v-if="hotPosts.length > 0"> <div class="summary-content" v-if="hotPosts.length > 0">
<BaseTimeline :items="hotPosts"> <BaseTimeline :items="hotPosts">
<template #item="{ item }"> <template #item="{ item }">
<router-link :to="`/posts/${item.post.id}`" class="timeline-link"> <NuxtLink :to="`/posts/${item.post.id}`" class="timeline-link">
{{ item.post.title }} {{ item.post.title }}
</router-link> </NuxtLink>
<div class="timeline-snippet"> <div class="timeline-snippet">
{{ stripMarkdown(item.post.snippet) }} {{ stripMarkdown(item.post.snippet) }}
</div> </div>
@@ -236,44 +236,44 @@
<template #item="{ item }"> <template #item="{ item }">
<template v-if="item.type === 'post'"> <template v-if="item.type === 'post'">
发布了文章 发布了文章
<router-link :to="`/posts/${item.post.id}`" class="timeline-link"> <NuxtLink :to="`/posts/${item.post.id}`" class="timeline-link">
{{ item.post.title }} {{ item.post.title }}
</router-link> </NuxtLink>
<div class="timeline-date">{{ formatDate(item.createdAt) }}</div> <div class="timeline-date">{{ formatDate(item.createdAt) }}</div>
</template> </template>
<template v-else-if="item.type === 'comment'"> <template v-else-if="item.type === 'comment'">
<router-link :to="`/posts/${item.comment.post.id}`" class="timeline-link"> <NuxtLink :to="`/posts/${item.comment.post.id}`" class="timeline-link">
{{ item.comment.post.title }} {{ item.comment.post.title }}
</router-link> </NuxtLink>
下评论了 下评论了
<router-link <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-link"
> >
{{ stripMarkdownLength(item.comment.content, 200) }} {{ stripMarkdownLength(item.comment.content, 200) }}
</router-link> </NuxtLink>
<div class="timeline-date">{{ formatDate(item.createdAt) }}</div> <div class="timeline-date">{{ formatDate(item.createdAt) }}</div>
</template> </template>
<template v-else-if="item.type === 'reply'"> <template v-else-if="item.type === 'reply'">
<router-link :to="`/posts/${item.comment.post.id}`" class="timeline-link"> <NuxtLink :to="`/posts/${item.comment.post.id}`" class="timeline-link">
{{ item.comment.post.title }} {{ item.comment.post.title }}
</router-link> </NuxtLink>
下对 下对
<router-link <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-link"
> >
{{ stripMarkdownLength(item.comment.parentComment.content, 200) }} {{ stripMarkdownLength(item.comment.parentComment.content, 200) }}
</router-link> </NuxtLink>
回复了 回复了
<router-link <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-link"
> >
{{ stripMarkdownLength(item.comment.content, 200) }} {{ stripMarkdownLength(item.comment.content, 200) }}
</router-link> </NuxtLink>
<div class="timeline-date">{{ formatDate(item.createdAt) }}</div> <div class="timeline-date">{{ formatDate(item.createdAt) }}</div>
</template> </template>
<template v-else-if="item.type === 'tag'"> <template v-else-if="item.type === 'tag'">