@minto-ai/mt-ui
Version:
UI组件库
12 lines (11 loc) • 426 B
TypeScript
import { ComponentInternalInstance, ComputedRef, InjectionKey } from 'vue';
type ParentProvide<T> = T & {
link: (child: ComponentInternalInstance) => void;
unlink: (child: ComponentInternalInstance) => void;
children: ComponentInternalInstance[];
};
declare function useParent<T>(key: InjectionKey<ParentProvide<T>>): {
parent: ParentProvide<T> | null;
index: ComputedRef<number>;
};
export { useParent };