temp-circle.vue 632 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <v-circle
  3. :config="{
  4. ...data,
  5. zIndex: undefined,
  6. opacity: addMode ? 0.3 : data.opacity,
  7. }"
  8. ref="shape"
  9. >
  10. </v-circle>
  11. </template>
  12. <script lang="ts" setup>
  13. import { CircleData, defaultStyle } from "./index.ts";
  14. import { computed, ref } from "vue";
  15. import { DC } from "@/deconstruction.js";
  16. import { Circle } from "konva/lib/shapes/Circle";
  17. const props = defineProps<{ data: CircleData; addMode?: boolean }>();
  18. const data = computed(() => ({ ...defaultStyle, ...props.data }));
  19. const shape = ref<DC<Circle>>();
  20. defineExpose({
  21. get shape() {
  22. return shape.value;
  23. },
  24. });
  25. </script>