chore: use builtin proseimg over custom element
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{ src: string }>();
|
||||
const props = withDefaults(defineProps<{ src: string; alt?: string }>(), {
|
||||
alt: "",
|
||||
});
|
||||
|
||||
const src = props.src;
|
||||
const imgSrc =
|
||||
@@ -10,7 +12,7 @@ const imgSrc =
|
||||
|
||||
<template>
|
||||
<figure class="flex flex-col items-center">
|
||||
<img :src="imgSrc" class="drop-shadow-lg" />
|
||||
<figcaption class="text-center m-0"><slot /></figcaption>
|
||||
<img :src="imgSrc" class="drop-shadow-lg" :alt="alt" />
|
||||
<figcaption class="text-center" v-if="alt">{{ alt }}</figcaption>
|
||||
</figure>
|
||||
</template>
|
Reference in New Issue
Block a user