public/components/content/image.vue
2023-05-23 18:12:14 -04:00

17 lines
411 B
Vue

<script setup lang="ts">
const props = defineProps<{ src: string }>();
const src = props.src;
const imgSrc =
src.startsWith("http://") || src.startsWith("https://")
? src
: `/images/posts/${src}`;
</script>
<template>
<figure class="flex flex-col items-center">
<img :src="imgSrc" class="drop-shadow-lg" />
<figcaption class="text-center m-0"><slot /></figcaption>
</figure>
</template>