epic-designer
Version:
基于vue3的设计器,可视化开发页面表单
55 lines (54 loc) • 1.81 kB
TypeScript
import { ComponentSchema, FormDataModel } from '../../../types/src/index';
import { Form } from 'ant-design-vue';
interface FormInstance extends InstanceType<typeof Form> {
getData?: () => FormDataModel;
scrollToField: (name: string) => void;
setData?: (data: FormDataModel) => void;
validate: () => Promise<unknown>;
validateFields: () => Promise<unknown>;
}
type __VLS_Props = {
componentSchema: ComponentSchema;
scrollToFirstError?: boolean;
};
/**
* 获取表单数据
*/
declare function getData(): FormDataModel;
/**
* 校验表单数据
*/
declare function validate(): Promise<unknown>;
/**
* 设置表单数据
* @param data
*/
declare function setData(data: FormDataModel): void;
declare function __VLS_template(): {
attrs: Partial<{}>;
slots: {
'edit-node'?(_: {}): any;
node?(_: {
componentSchema: ComponentSchema;
}): any;
};
refs: {};
rootEl: HTMLDivElement;
};
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
form: import('vue').Ref<FormInstance | null, FormInstance | null>;
getData: typeof getData;
setData: typeof setData;
validate: typeof validate;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
componentSchema: ComponentSchema;
scrollToFirstError: boolean;
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};