PronounsPage/app/components/ImageThumb.vue
Valentyne Stigloher 10180aa6a3 (refactor) use #shared alias instead of ~~/shared
the #shared alias used by Nuxt cannot be easily disabled and to prevent breackage with jiti, we make use of it
2025-08-17 18:56:02 +02:00

39 lines
1.0 KiB
Vue

<template>
<a
:href="buildImageUrl($config.public.cloudfront, id, bigSize)"
target="_blank"
rel="noopener"
class="d-inline-block"
@click.prevent="store.lightboxUrl = buildImageUrl($config.public.cloudfront, id, bigSize)"
>
<img
:src="buildImageUrl($config.public.cloudfront, id, smallSize)"
class="border rounded-2"
:style="`height: ${size}; width: auto;`"
loading="lazy"
>
</a>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { buildImageUrl } from '#shared/helpers.ts';
import { useMainStore } from '~/store/index.ts';
export default defineComponent({
props: {
id: { required: true, type: String },
smallSize: { default: 'thumb', type: String },
bigSize: { default: 'big', type: String },
size: { default: 'auto', type: String },
},
setup() {
return {
store: useMainStore(),
};
},
methods: { buildImageUrl },
});
</script>