public/components/content/image.vue
eggy 577e00a870 chore: switch away from reactivity transform
also use a released version of nuxt
2023-01-28 15:32:48 -05:00

17 lines
384 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" />
<figcaption class="text-center"><slot /></figcaption>
</figure>
</template>