Files
takerofnotes-website/components/prismic/Image.vue
2026-05-29 11:22:56 -04:00

28 lines
582 B
Vue

<template>
<img
class="prismic-image"
:alt="alt"
:width="width"
:height="height"
:src="src"
/>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
field: {
type: [String, Object],
required: true,
},
})
const src = computed(() =>
typeof props.field == 'string' ? props.field : props.field?.url,
)
const width = computed(() => props.field?.width || '')
const height = computed(() => props.field?.height || '')
const alt = computed(() => props.field?.alt || '')
</script>