generated from pascalmartineau/wp-skeleton
feat: Initial TheSections
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
fragment ThePage on Page {
|
||||
title
|
||||
groupPostPage {
|
||||
sections {
|
||||
...TheSection
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ defineProps<{ node: ThePageFragment }>();
|
||||
|
||||
<template>
|
||||
<UPage>
|
||||
<UPageSection v-if="node.title" :title="node.title" />
|
||||
<TheSections :sections="node.groupPostPage?.sections" />
|
||||
</UPage>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fragment SectionTextBlock on GroupAbstractBuilderSectionsTextBlockLayout {
|
||||
content
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { SectionTextBlockFragment } from "#graphql-operations";
|
||||
|
||||
defineProps<SectionTextBlockFragment>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section data-section-type="text-block">
|
||||
<div v-html="content" />
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,6 @@
|
||||
fragment TheSection on GroupAbstractBuilderSections_Layout {
|
||||
fieldGroupName
|
||||
... on GroupAbstractBuilderSectionsTextBlockLayout {
|
||||
...SectionTextBlock
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import type { TheSectionFragment } from "#graphql-operations";
|
||||
|
||||
const props = defineProps<{ sections: (TheSectionFragment)[] }>();
|
||||
const sections = props.sections.map(useSection);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="component" v-for="({ component, attrs }, i) in sections" :key="i" v-bind="attrs" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user