fix(theme): add fallback for `heroImageSlotExists` (#5076)

for users who are importing VPHero in custom theme
pull/5085/head
Michael Cozzolino 4 months ago committed by GitHub
parent 66cf64e6d1
commit f119b18e39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { DefaultTheme } from 'vitepress/theme'
import { inject } from 'vue'
import { computed, inject } from 'vue'
import { layoutInfoInjectionKey } from '../composables/layout'
import VPButton from './VPButton.vue'
import VPImage from './VPImage.vue'
@ -21,7 +21,10 @@ defineProps<{
actions?: HeroAction[]
}>()
const { heroImageSlotExists } = inject(layoutInfoInjectionKey)!
const { heroImageSlotExists } = inject(
layoutInfoInjectionKey,
{ heroImageSlotExists: computed(() => false) }
)
</script>
<template>

Loading…
Cancel
Save