mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-27 03:01:14 +08:00
26 lines
909 B
Vue
26 lines
909 B
Vue
|
<script setup lang="ts">
|
||
|
import { computed } from 'vue'
|
||
|
import { useData, useRoute } from 'vitepress'
|
||
|
import { useSidebar } from '../composables/sidebar'
|
||
|
import VPHeroContent from './vp-hero-content.vue'
|
||
|
import VPDocContent from './vp-doc-content.vue'
|
||
|
import VPNotFound from './vp-not-found.vue'
|
||
|
|
||
|
const { frontmatter } = useData()
|
||
|
const route = useRoute()
|
||
|
const isNotFound = computed(() => route.component === VPNotFound)
|
||
|
const isHeroPost = computed(() => frontmatter.value.page === true)
|
||
|
const { hasSidebar } = useSidebar()
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<main :class="{ 'page-content': true, 'has-sidebar': hasSidebar }">
|
||
|
<VPNotFound v-if="isNotFound" />
|
||
|
<VPHeroContent v-else-if="isHeroPost" />
|
||
|
<VPDocContent v-else>
|
||
|
<template #content-top><slot name="content-top" /></template>
|
||
|
<template #content-bottom><slot name="content-bottom" /></template>
|
||
|
</VPDocContent>
|
||
|
</main>
|
||
|
</template>
|