mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-12-04 19:57:26 +00:00
63df2c851e
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
48 lines
869 B
Vue
48 lines
869 B
Vue
<template>
|
|
<div class="ysrxegms">
|
|
<canvas ref="canvas" :width="block.width" :height="block.height"/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent, onMounted, PropType, Ref, ref } from 'vue';
|
|
import { CanvasBlock } from '@/scripts/hpml/block';
|
|
import { Hpml } from '@/scripts/hpml/evaluator';
|
|
|
|
export default defineComponent({
|
|
props: {
|
|
block: {
|
|
type: Object as PropType<CanvasBlock>,
|
|
required: true,
|
|
},
|
|
hpml: {
|
|
type: Object as PropType<Hpml>,
|
|
required: true,
|
|
},
|
|
},
|
|
setup(props, ctx) {
|
|
const canvas: Ref<any> = ref(null);
|
|
|
|
onMounted(() => {
|
|
props.hpml.registerCanvas(props.block.name, canvas.value);
|
|
});
|
|
|
|
return {
|
|
canvas,
|
|
};
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.ysrxegms {
|
|
display: inline-block;
|
|
vertical-align: bottom;
|
|
overflow: auto;
|
|
max-width: 100%;
|
|
|
|
> canvas {
|
|
display: block;
|
|
}
|
|
}
|
|
</style>
|