embedding
This commit is contained in:
parent
9d81666a3c
commit
69fd756a5a
5 changed files with 29 additions and 3 deletions
|
@ -10,6 +10,7 @@
|
|||
<DynamicZoneFullText v-else-if="item.__component == 'dynamic-zone.full-text'" :data="item" />
|
||||
<DynamicZoneGallery v-else-if="item.__component == 'dynamic-zone.gallery'" :data="item" />
|
||||
<DynamicZoneFileDownload v-else-if="item.__component == 'dynamic-zone.file-download'" :data="item" />
|
||||
<DynamicZoneEmbedding v-else-if="item.__component == 'dynamic-zone.embedding'" :data="item" />
|
||||
<SharedList v-else-if="item.__component == 'shared.list'" :data="item" />
|
||||
<br />
|
||||
</div>
|
||||
|
|
15
components/dynamicZone/Embedding.vue
Normal file
15
components/dynamicZone/Embedding.vue
Normal file
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<div class="flex flex-col gap-2 w-full min-h-fit max-w-4xl mx-auto">
|
||||
<h1 class="text-center">{{ data.title }}</h1>
|
||||
<iframe :src="data.link" class="w-full h-[90vh]"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { PropType } from "vue";
|
||||
import type DynamicZoneEmbedding from "../../types/component/dynamicZoneEmbedding";
|
||||
|
||||
const props = defineProps({
|
||||
data: Object as PropType<DynamicZoneEmbedding>,
|
||||
});
|
||||
</script>
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div v-if="showComponent" class="flex flex-col gap-2 w-full min-h-fit max-w-4xl mx-auto">
|
||||
<h1 class="text-center">{{ data?.title }}</h1>
|
||||
<h1 class="text-center">{{ data.title }}</h1>
|
||||
<iframe v-if="data.file.mime == 'application/pdf'" :src="baseUrl + data.file.url" class="w-full h-[90vh]"></iframe>
|
||||
<NuxtPicture
|
||||
v-if="data.file.mime.includes('image')"
|
||||
|
|
|
@ -6,6 +6,7 @@ import type DynamicZoneFullText from "./dynamicZoneFullText";
|
|||
import type DynamicZoneGallery from "./dynamicZoneGallery";
|
||||
import type DynamicZoneFileDownload from "./dynamicZoneFileDownload";
|
||||
import type SharedList from "./sharedList";
|
||||
import type DynamicZoneEmbedding from "./dynamicZoneEmbedding";
|
||||
|
||||
export default interface BaseComponent {
|
||||
__component: ComponentNames;
|
||||
|
@ -20,7 +21,8 @@ export type ComponentNames =
|
|||
| "dynamic-zone.emphasise-article"
|
||||
| "dynamic-zone.dual-column-text"
|
||||
| "dynamic-zone.column-image-text"
|
||||
| "dynamic-zone.file-download";
|
||||
| "dynamic-zone.file-download"
|
||||
| "dynamic-zone.embedding";
|
||||
|
||||
export type ComponentTypes =
|
||||
| SharedList
|
||||
|
@ -30,4 +32,5 @@ export type ComponentTypes =
|
|||
| DynamicZoneEmphasiseArticle
|
||||
| DynamicZoneDualColumnText
|
||||
| DynamicZoneColumnImageText
|
||||
| DynamicZoneFileDownload;
|
||||
| DynamicZoneFileDownload
|
||||
| DynamicZoneEmbedding;
|
||||
|
|
7
types/component/dynamicZoneEmbedding.ts
Normal file
7
types/component/dynamicZoneEmbedding.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import type BaseComponent from "./baseComponent";
|
||||
|
||||
export default interface DynamicZoneEmbedding extends BaseComponent {
|
||||
__component: "dynamic-zone.embedding";
|
||||
title: string;
|
||||
link: string;
|
||||
}
|
Loading…
Reference in a new issue