diff --git a/frontend/components/Location/Tree/Node.vue b/frontend/components/Location/Tree/Node.vue new file mode 100644 index 0000000..9debd87 --- /dev/null +++ b/frontend/components/Location/Tree/Node.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/frontend/components/Location/Tree/Root.vue b/frontend/components/Location/Tree/Root.vue new file mode 100644 index 0000000..6ace6d7 --- /dev/null +++ b/frontend/components/Location/Tree/Root.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/frontend/components/Location/Tree/tree-state.ts b/frontend/components/Location/Tree/tree-state.ts new file mode 100644 index 0000000..f344394 --- /dev/null +++ b/frontend/components/Location/Tree/tree-state.ts @@ -0,0 +1,17 @@ +import type { Ref } from "vue"; + +type TreeState = Record; + +const store: Record> = {}; + +export function newTreeKey(): string { + return Math.random().toString(36).substring(2); +} + +export function useTreeState(key: string): Ref { + if (!store[key]) { + store[key] = ref({}); + } + + return store[key]; +}