100a131913
* pages refactoring * pages: fix if block * fix code format * remove passing of the page parameter * remove comment * fix indent * replace with unref * fix conditions of isVarBlock() * Update src/client/scripts/hpml/block.ts use includes() instead of find() Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
40 lines
710 B
Vue
40 lines
710 B
Vue
<template>
|
|
<div class="lzyxtsnt">
|
|
<img v-if="image" :src="image.url"/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent, PropType } from 'vue';
|
|
import * as os from '@/os';
|
|
import { ImageBlock } from '@/scripts/hpml/block';
|
|
import { Hpml } from '@/scripts/hpml/evaluator';
|
|
|
|
export default defineComponent({
|
|
props: {
|
|
block: {
|
|
type: Object as PropType<ImageBlock>,
|
|
required: true
|
|
},
|
|
hpml: {
|
|
type: Object as PropType<Hpml>,
|
|
required: true
|
|
}
|
|
},
|
|
setup(props, ctx) {
|
|
const image = props.hpml.page.attachedFiles.find(x => x.id === props.block.fileId);
|
|
|
|
return {
|
|
image
|
|
};
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.lzyxtsnt {
|
|
> img {
|
|
max-width: 100%;
|
|
}
|
|
}
|
|
</style>
|