UNPKG

create-iking-admin

Version:

金合技术中台脚手架

26 lines (21 loc) 716 B
/* * @Author: wfl * @LastEditors: wfl * @description: * @updateInfo: * @Date: 2022-08-12 18:42:51 * @LastEditTime: 2022-08-29 14:06:05 */ import { ikingCore } from 'iking-vue-hooks'; import type { ComputedRef, InjectionKey } from 'vue'; export interface ContentContextProps { contentHeight: ComputedRef<number>; setPageHeight: (height: number) => Promise<void>; } const key: InjectionKey<ContentContextProps> = Symbol(); export function createContentContext(context: ContentContextProps) { return ikingCore.createContext<ContentContextProps>(context, key, { native: true }); } export function useContentContext() { return ikingCore.useContext<ContentContextProps>(key); }