vben
authored
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
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);
}
|