This commit is contained in:
deploy-bot committed 2026-12-04 18:41:33 +00:00
commit 1396974b03
286 files changed
+19411

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
<script setup lang="ts">
import { computed, type Component } from 'vue';
import { blockComponents } from './components';
import type { Block } from './support';
// Draws the blocks of a page (`Blocks::for()` as a prop): one component per type. `components` replaces or adds a type of the site;
// a type without a component draws nothing.
const props = defineProps<{ blocks: Block[]; components?: Record<string, Component> }>();
const map = computed(() => ({ ...blockComponents, ...(props.components ?? {}) }));
</script>
<template>
<template v-for="block in blocks" :key="block.id">
<component :is="map[block.type]" v-if="map[block.type]" :data="block.data" :style="block.style" :items="block.items" />
</template>
</template>