<template>
	<div id="container"></div>
</template>

<script setup lang="ts">
import { useWindowSize } from '@vueuse/core';
import Konva from 'konva/lib';
import { onMounted } from 'vue';

const { width, height } = useWindowSize();
const initial = () => {
	const stage = new Konva.Stage({
		container: 'container',
		width: width.value,
		height: height.value,
	});

	const layer = new Konva.Layer({ draggable: true });

	layer.add(
		new Konva.Arrow({
			x: 100,
			y: 150,
			points: [0, 10, 100, 100],
			pointerLength: 20,
			fill: 'red',
			stroke: 'black',
			strokeWidth: 2,
		}),
	);

	stage.add(layer);
};

onMounted(() => {
	initial();
});
</script>
