fix(plugin-search): incorrect page path when configuring base, close #265 (#267)

This commit is contained in:
pengzhanbo 2024-10-12 15:02:53 +08:00 committed by GitHub
parent 2b5c0dfc80
commit 012cbafaaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,7 @@ import {
toRef,
watch,
} from 'vue'
import { useRouteLocale, useRouter } from 'vuepress/client'
import { useRouteLocale, useRouter, withBase } from 'vuepress/client'
import { useLocale, useSearchIndex } from '../composables/index.js'
import { LRUCache } from '../utils/index.js'
import BackIcon from './icons/BackIcon.vue'
@ -359,7 +359,7 @@ function formMarkRegex(terms: Set<string>) {
:aria-selected="selectedIndex === index ? 'true' : 'false'"
>
<a
:href="p.id"
:href="withBase(p.id)"
class="result"
:class="{
selected: selectedIndex === index,