schlechtenburg/packages/core/lib/use-root-element.ts

12 lines
264 B
TypeScript

import {
Ref,
ref,
inject,
} from 'vue';
export const SymRootElement = Symbol('Schlechtenburg root element');
export const useRootElement = () => {
const rootElement: Ref<HTMLElement|null> = inject(SymRootElement, ref(null));
return { rootElement };
};