mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 20:54:40 +08:00
17 lines
516 B
TypeScript
17 lines
516 B
TypeScript
import { InjectionKey, Ref } from 'vue';
|
|
import { createContext, useContext } from '/@/hooks/core/useContext';
|
|
|
|
export interface LayoutContextProps {
|
|
fullHeaderRef: Ref<ComponentRef>;
|
|
}
|
|
|
|
const layoutContextInjectKey: InjectionKey<LayoutContextProps> = Symbol();
|
|
|
|
export function createLayoutContext(context: LayoutContextProps) {
|
|
return createContext<LayoutContextProps>(context, layoutContextInjectKey);
|
|
}
|
|
|
|
export function useLayoutContext() {
|
|
return useContext<LayoutContextProps>(layoutContextInjectKey);
|
|
}
|