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