v0.9.1
This commit is contained in:
commit
5b230c75aa
278 files changed
+18390
No files matched your search
@@ -0,0 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import Buttons from './Buttons.vue';
|
||||
import { classes, pick, safeUrl, type Item } from './support';
|
||||
|
||||
// A record is shown under the usual names: title or name, summary / story / quote / intro / role, photo / picture / image, url / link.
|
||||
defineProps<{ data: Record<string, any>; style?: Record<string, string>; items?: Item[] }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section :class="['mb-block mb-cards', classes(style)]">
|
||||
<div class="mb-inner">
|
||||
<p v-if="data.eyebrow" class="mb-eyebrow">{{ data.eyebrow }}</p>
|
||||
<h2 v-if="data.title">{{ data.title }}</h2>
|
||||
<div class="mb-grid">
|
||||
<article v-for="(item, index) in items || []" :key="item.id ?? index" class="mb-card">
|
||||
<img v-if="pick(item, ['photo', 'picture', 'image'])" :src="safeUrl(pick(item, ['photo', 'picture', 'image']))" alt="" loading="lazy" />
|
||||
<h3>
|
||||
<a v-if="pick(item, ['url', 'link'])" :href="safeUrl(pick(item, ['url', 'link']))">{{ pick(item, ['title', 'name', 'label']) }}</a>
|
||||
<template v-else>{{ pick(item, ['title', 'name', 'label']) }}</template>
|
||||
</h3>
|
||||
<p v-if="pick(item, ['summary', 'story', 'quote', 'intro', 'role'])">{{ pick(item, ['summary', 'story', 'quote', 'intro', 'role']) }}</p>
|
||||
</article>
|
||||
</div>
|
||||
<Buttons v-if="data.button_label" :buttons="[{ label: data.button_label, url: data.button_url, style: 'secondary' }]" />
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
Reference in new issue
Block a user