egirlskey/packages/frontend/src/components/page/page.image.vue

20 lines
666 B
Vue
Raw Normal View History

<template>
2023-05-12 02:46:13 +00:00
<div>
<ImgWithBlurhash v-if="image" style="max-width: 100%;" :hash="image.blurhash" :src="image.url" :alt="image.comment" :title="image.comment" :width="image.properties.width" :height="image.properties.height" :cover="false"/>
</div>
</template>
<script lang="ts" setup>
import { PropType } from 'vue';
import ImgWithBlurhash from '@/components/MkImgWithBlurhash.vue';
2021-11-11 17:02:25 +00:00
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>