Files
lichx-blog/composables/useNavbarHeight.ts
T

10 lines
225 B
TypeScript

const KEY: InjectionKey<Ref<number>> = Symbol('navbarHeight');
export function provideNavbarHeight(h: Ref<number>) {
provide(KEY, h);
}
export function injectNavbarHeight(): Ref<number> {
return inject(KEY, ref(48));
}