fix(theme): fix swiper slide link with base (#609)

This commit is contained in:
pengzhanbo 2025-06-01 21:38:14 +08:00 committed by GitHub
parent 7ed3f6ffd1
commit 46effe8866
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,6 +15,7 @@ import {
} from 'swiper/modules'
import { Swiper, SwiperSlide } from 'swiper/vue'
import { computed, onMounted } from 'vue'
import { withBase } from 'vuepress/client'
import 'swiper/css'
import 'swiper/css/navigation'
@ -68,8 +69,9 @@ const props = withDefaults(defineProps<Props>(), {
const slideList = computed<SlideItem[]>(() => {
return props.items?.map((link) => {
if (typeof link === 'string')
return { link }
return { link: withBase(link) }
link.link = withBase(link.link)
return link
}) ?? []
})