mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 09:49:05 +01:00
fac2e57a0e
* refactor to composition API * use existing image component This improves user experience because alt text is displayed correctly. * fix: correct image src * fix: defineProps * fix
29 lines
719 B
Vue
29 lines
719 B
Vue
<template>
|
|
<div class="lzyxtsnt">
|
|
<ImgWithBlurhash v-if="image" :hash="image.blurhash" :src="image.url" :alt="image.comment" :title="image.comment" :cover="false"/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { defineComponent, PropType } from 'vue';
|
|
import ImgWithBlurhash from '@/components/img-with-blurhash.vue';
|
|
import * as os from '@/os';
|
|
import { ImageBlock } from '@/scripts/hpml/block';
|
|
import { Hpml } from '@/scripts/hpml/evaluator';
|
|
|
|
const props = defineProps<{
|
|
block: PropType<ImageBlock>,
|
|
hpml: PropType<Hpml>,
|
|
}>();
|
|
|
|
const image = props.hpml.page.attachedFiles.find(x => x.id === props.block.fileId);
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.lzyxtsnt {
|
|
> img {
|
|
max-width: 100%;
|
|
}
|
|
}
|
|
</style>
|