mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
fix(theme): fix blog cover layout error in mobile (#611)
This commit is contained in:
parent
d5ea846e8a
commit
3c2a34729e
@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import type { BlogPostCoverStyle, ThemeBlogPostItem } from '../../../shared/index.js'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { useMediaQuery } from '@vueuse/core'
|
||||
import { computed } from 'vue'
|
||||
import { isMobile as _isMobile } from '@vuepress/helper/client'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { withBase } from 'vuepress/client'
|
||||
import { useData, useInternalLink, useTagColors } from '../../composables/index.js'
|
||||
|
||||
@ -11,8 +11,16 @@ const props = defineProps<{
|
||||
index: number
|
||||
}>()
|
||||
|
||||
const isMobile = ref(false)
|
||||
|
||||
onMounted(() => {
|
||||
isMobile.value = _isMobile(navigator.userAgent)
|
||||
window.addEventListener('resize', () => {
|
||||
isMobile.value = _isMobile(navigator.userAgent)
|
||||
})
|
||||
})
|
||||
|
||||
const { blog } = useData()
|
||||
const isMobile = useMediaQuery('(max-width: 496px)')
|
||||
const colors = useTagColors()
|
||||
const { categories: categoriesLink, tags: tagsLink } = useInternalLink()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user