fix(theme): fix blog cover link with base (#608)
This commit is contained in:
parent
cb8d8af2ce
commit
7ed3f6ffd1
@ -3,6 +3,7 @@ import type { BlogPostCoverStyle, ThemeBlogPostItem } from '../../../shared/inde
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { useMediaQuery } from '@vueuse/core'
|
||||
import { computed } from 'vue'
|
||||
import { withBase } from 'vuepress/client'
|
||||
import { useData, useInternalLink, useTagColors } from '../../composables/index.js'
|
||||
|
||||
const props = defineProps<{
|
||||
@ -88,13 +89,13 @@ const coverStyles = computed(() => {
|
||||
<template>
|
||||
<div
|
||||
class="vp-blog-post-item" data-allow-mismatch
|
||||
:class="{ 'has-cover': props.post.cover, [coverLayout]: cover }"
|
||||
:class="{ 'has-cover': post.cover, [coverLayout]: cover }"
|
||||
>
|
||||
<div
|
||||
v-if="props.post.cover" class="post-cover" data-allow-mismatch
|
||||
v-if="post.cover" class="post-cover" data-allow-mismatch
|
||||
:class="{ compact: coverCompact }" :style="coverStyles"
|
||||
>
|
||||
<img :src="props.post.cover" :alt="post.title" loading="lazy">
|
||||
<img :src="withBase(post.cover)" :alt="post.title" loading="lazy">
|
||||
</div>
|
||||
<div class="blog-post-item-content">
|
||||
<h3>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user