Skip to content

Commit

Permalink
extract AppPartial component
Browse files Browse the repository at this point in the history
  • Loading branch information
Towerism committed May 25, 2024
1 parent a7f3144 commit 07b22b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 14 additions & 0 deletions components/AppPartial.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<ContentQuery :path="partial" find="one" v-slot="{ data }">
<ContentRenderer :value="data" />
</ContentQuery>
</template>

<script setup>
defineProps({
partial: {
type: String,
required: true,
},
});
</script>
10 changes: 1 addition & 9 deletions pages/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,9 @@
>
<div class="flex flex-col justify-center">
<ContentDoc />
<ContentRenderer :value="data" />
<AppPartial partial="/_call-to-action" />
</div>
</main>
</div>
<AppFooter />
</template>

<script setup>
const { data } = await useAsyncData("page-data", () =>
queryContent().where({ _path: "/_call-to-action" }).findOne(),
);
console.log(data);
</script>

0 comments on commit 07b22b9

Please sign in to comment.