feat: AcfImage / AcfMedia with @nuxt/image
This commit is contained in:
16
wp-content/themes/headless/app/components/acf/AcfImage.vue
Normal file
16
wp-content/themes/headless/app/components/acf/AcfImage.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import type { AcfImageFragment } from "#graphql/types";
|
||||
|
||||
defineProps<{ image: AcfImageFragment }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NuxtImg
|
||||
:src="image.src"
|
||||
:alt="image.alt"
|
||||
:width="image.mediaDetails?.width"
|
||||
:height="image.mediaDetails?.height"
|
||||
:style="{ objectPosition: image.objectPosition }"
|
||||
placeholder
|
||||
/>
|
||||
</template>
|
||||
Reference in New Issue
Block a user