2020-04-15 17:39:21 +02:00
|
|
|
<template>
|
2020-04-18 11:33:45 +02:00
|
|
|
<div class="ysrxegms">
|
2021-01-30 02:59:05 +01:00
|
|
|
<canvas ref="canvas" :width="block.width" :height="block.height"/>
|
2020-04-15 17:39:21 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-01-30 02:59:05 +01:00
|
|
|
import { defineComponent, onMounted, PropType, Ref, ref } from 'vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import { CanvasBlock } from '@/scripts/hpml/block';
|
|
|
|
import { Hpml } from '@/scripts/hpml/evaluator';
|
2020-04-15 17:39:21 +02:00
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
export default defineComponent({
|
2020-04-15 17:39:21 +02:00
|
|
|
props: {
|
2021-01-30 02:59:05 +01:00
|
|
|
block: {
|
|
|
|
type: Object as PropType<CanvasBlock>,
|
2022-12-22 08:01:59 +01:00
|
|
|
required: true,
|
2020-04-15 17:39:21 +02:00
|
|
|
},
|
2020-04-20 14:35:27 +02:00
|
|
|
hpml: {
|
2021-01-30 02:59:05 +01:00
|
|
|
type: Object as PropType<Hpml>,
|
2022-12-22 08:01:59 +01:00
|
|
|
required: true,
|
|
|
|
},
|
2020-04-15 17:39:21 +02:00
|
|
|
},
|
2021-01-30 02:59:05 +01:00
|
|
|
setup(props, ctx) {
|
|
|
|
const canvas: Ref<any> = ref(null);
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
props.hpml.registerCanvas(props.block.name, canvas.value);
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
2022-12-22 08:01:59 +01:00
|
|
|
canvas,
|
2021-01-30 02:59:05 +01:00
|
|
|
};
|
2022-12-22 08:01:59 +01:00
|
|
|
},
|
2020-04-15 17:39:21 +02:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2022-12-27 10:29:39 +01:00
|
|
|
<style lang="scss" scoped>
|
2020-04-15 17:39:21 +02:00
|
|
|
.ysrxegms {
|
2020-04-18 11:33:45 +02:00
|
|
|
display: inline-block;
|
|
|
|
vertical-align: bottom;
|
2020-04-19 09:15:24 +02:00
|
|
|
overflow: auto;
|
|
|
|
max-width: 100%;
|
2020-04-18 11:33:45 +02:00
|
|
|
|
|
|
|
> canvas {
|
|
|
|
display: block;
|
|
|
|
}
|
2020-04-15 17:39:21 +02:00
|
|
|
}
|
|
|
|
</style>
|