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

25 lines
742 B
Vue
Raw Normal View History

<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
2023-05-12 04:46:13 +02: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>
2023-05-14 03:50:21 +02:00
import { } from 'vue';
import * as Misskey from 'misskey-js';
import { ImageBlock } from './block.type';
import ImgWithBlurhash from '@/components/MkImgWithBlurhash.vue';
const props = defineProps<{
2023-05-14 03:50:21 +02:00
block: ImageBlock,
page: Misskey.entities.Page,
}>();
2023-05-14 03:50:21 +02:00
const image = props.page.attachedFiles.find(x => x.id === props.block.fileId);
</script>