diff --git a/src/api/use-relation.ts b/src/api/use-relation.ts index 5ab204708..d7ab9a027 100644 --- a/src/api/use-relation.ts +++ b/src/api/use-relation.ts @@ -1,7 +1,7 @@ import { ref, Ref, provide, inject, computed, onUnmounted } from 'vue'; -export type Parent = null | { - children: Ref; +export type Parent = null | { + children: Ref[]>; }; export function useChildren(key: string) { @@ -10,8 +10,8 @@ export function useChildren(key: string) { return children; } -export function useParent(key: string, child: unknown) { - const parent = inject(key, null); +export function useParent(key: string, child: Ref) { + const parent = inject>(key, null); if (parent) { const children = parent.children.value;