Skip to content

Commit 7b9a5a8

Browse files
authored
feat: add group component
1 parent e047572 commit 7b9a5a8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/components/Group.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<g v-bind="$attrs">
3+
<slot />
4+
</g>
5+
</template>
6+
7+
<script lang="ts" setup>
8+
import { toRef } from "vue";
9+
import { PossibleVector2, Vector2 } from "../utils/Vector2.ts";
10+
import { useLocalToWorld } from "../composables/useLocalToWorld.ts";
11+
12+
const props = withDefaults(
13+
defineProps<{ position?: PossibleVector2; }>(), { position: () => new Vector2() });
14+
15+
useLocalToWorld(toRef(props, "position"));
16+
</script>

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export { default as Circle } from "./components/Circle.vue";
44
export { default as Ellipse } from "./components/Ellipse.vue";
55
export { default as FunctionPlot } from "./components/FunctionPlot.vue";
66
export { default as Graph } from "./components/Graph.vue";
7+
export { default as Group } from "./components/Group.vue";
78
export { default as Label } from "./components/Label.vue";
89
export { default as Line } from "./components/Line.vue";
910
export { default as Point } from "./components/Point.vue";

0 commit comments

Comments
 (0)