UNPKG

@aplus-frontend/ui

Version:

26 lines (25 loc) 881 B
import { NamePath } from '@aplus-frontend/antdv/es/form/interface'; import { ComputedRef, InjectionKey } from 'vue'; import { ApFormInternalInstance } from './interface'; type ApFormContextProps<ModelType> = { /** * Form数据源 */ model?: ComputedRef<ModelType>; /** * 更新数据源的方法 * @param name * @param value * @param triggerChange 是否触发外部的`onValuesChange`函数 * @returns */ updateModel?: (name: NamePath, value: any, triggerChange?: boolean) => void; /** * ApForm内部实例 */ internalInstance?: ApFormInternalInstance; }; export declare const ApFormContextKey: InjectionKey<ApFormContextProps<any>>; export declare function useProvideForm<ModelType>(state: ApFormContextProps<ModelType>): void; export declare function useInjectForm(): ApFormContextProps<any>; export {};