package list from viandwi24
This commit is contained in:
30
components/Page/Content/Doc.vue
Normal file
30
components/Page/Content/Doc.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
emptyTip: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'This page is empty',
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ContentDoc>
|
||||
<template #default="{ doc }">
|
||||
<PageHeader>
|
||||
<PageTitle :text="doc.title" />
|
||||
</PageHeader>
|
||||
<PageBody>
|
||||
<PageSection>
|
||||
<ContentRenderer :value="doc" />
|
||||
</PageSection>
|
||||
</PageBody>
|
||||
</template>
|
||||
<template #empty>
|
||||
<h1>{{ emptyTip }}</h1>
|
||||
</template>
|
||||
<template #not-found>
|
||||
<Error :code="404" wrap />
|
||||
</template>
|
||||
</ContentDoc>
|
||||
</template>
|
||||
29
components/Page/Content/Renderer.vue
Normal file
29
components/Page/Content/Renderer.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
path: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
pageTitle: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
})
|
||||
|
||||
const { data } = await useAsyncData(props.path, () =>
|
||||
queryContent(props.path).findOne()
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PageWrapper>
|
||||
<PageHeader>
|
||||
<PageTitle :text="pageTitle" class="capitalize" />
|
||||
</PageHeader>
|
||||
<PageBody>
|
||||
<PageSection>
|
||||
<ContentRenderer :value="data" />
|
||||
</PageSection>
|
||||
</PageBody>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
Reference in New Issue
Block a user