Skip to content

Commit d829473

Browse files
committed
fix: 修复反馈搜索建议链接跳转转错误的问题
1 parent f8cd4a5 commit d829473

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/components/forum/ForumSearchSuggestions.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import type ForumAPI from '@/apis/forum/api'
3-
import { useData, withBase } from 'vitepress'
3+
import { useData } from 'vitepress'
44
import { computed } from 'vue'
55
import { getLangPath } from '@/utils'
66
import ForumTopicTypeBadge from './ui/ForumTopicTypeBadge.vue'
@@ -20,7 +20,7 @@ const { localeIndex } = useData()
2020
2121
// Generate correct topic link with locale and base
2222
function getTopicLink(topicId: string | number): string {
23-
return `.${withBase(`${getLangPath(localeIndex.value)}feedback/topic/${topicId}`)}`
23+
return `.${`${getLangPath(localeIndex.value)}feedback/topic/${topicId}`}`
2424
}
2525
2626
function highlightText(text: string, keyword: string, scope: number = 20) {
@@ -71,21 +71,21 @@ const filteredItems = computed(() => {
7171
</script>
7272

7373
<template>
74-
<div class="w-full pb-8">
74+
<div class="pb-8 w-full">
7575
<h2 v-if="filteredItems.length > 0" class="mb-5">
7676
Suggested Searches
7777
</h2>
7878
<ul
79-
class="grid grid-row-auto grid-flow-col grid-flow-row grid-cols-1 gap-y-4"
79+
class="gap-y-4 grid grid-row-auto grid-flow-col grid-flow-row grid-cols-1"
8080
>
81-
<li v-for="item in filteredItems" :key="item.id" class="search-term w-full flex cursor-pointer items-center gap-4">
82-
<span class="vp-icon DocSearch-Search-Icon inline-block size-4 important:bg-[--vp-c-text-3]" aria-hidden="true" />
81+
<li v-for="item in filteredItems" :key="item.id" class="search-term flex gap-4 w-full cursor-pointer items-center">
82+
<span class="vp-icon DocSearch-Search-Icon size-4 inline-block important:bg-[--vp-c-text-3]" aria-hidden="true" />
8383
<VPLink
84-
:no-icon="true" :href="getTopicLink(item.id)" class="search-term w-full overflow-hidden text-ellipsis break-all"
84+
:no-icon="true" :href="getTopicLink(item.id)" class="search-term w-full break-all text-ellipsis overflow-hidden"
8585
@click="emits('select')"
8686
>
8787
<div class="flex items-center">
88-
<h4 class="line-clamp-1 mr-4" v-html="item.type === 'BUG' ? item.highlightedContent : item.highlightedTitle" />
88+
<h4 class="mr-4 line-clamp-1" v-html="item.type === 'BUG' ? item.highlightedContent : item.highlightedTitle" />
8989
<ForumTopicTypeBadge :type="item.type" />
9090
</div>
9191
</VPLink>

0 commit comments

Comments
 (0)