import { ValidTrigger } from './FormContext'; import { Rule } from 'async-validator'; import { ColProps } from './Layout/Col.vue'; export interface Form { clearValidate: (name?: string | string[]) => void; resetFields: (name?: string | string[]) => void; scrollToField: (name: string) => void; validate: (name?: string | string[]) => void; submit: (valid?: boolean) => void; } export interface FormProps { /** * 表单数据对象 */ model?: Record; /** * 表单验证规则 */ rules?: Record; /** * 配置 Form.Item 的 colon 的默认值 */ colon?: boolean; /** * 隐藏所有表单项的必选标记 */ hideRequiredMark?: boolean; /** * 统一设置左侧文本宽度 */ labelWidth?: number | string; /** * 统一设置左侧文本对齐 */ labelAlign?: 'left' | 'center' | 'right' | 'end'; /** * 统一设置左侧文本的flex占比,默认是2 */ labelCol?: ColProps; /** * 统一设置输入框的flex占比 */ wrapperCol?: ColProps; /** * 统一设置字段校验规则 * * onBlur 文本框失去焦点时校验 * * onValueChange 数值更改时校验 * * submit 提交时校验(默认) */ validateTrigger?: ValidTrigger; /** * 是否显左边标题,默认是 */ showLabel?: boolean; /** * 表单的名称 */ name?: string; } declare function clearValidate(name?: string | string[]): void; declare function resetFields(name?: string | string[]): void; declare function scrollToField(name: string): void; declare function validate(name?: string | string[]): Promise; declare function submit(valid?: boolean): void; declare function __VLS_template(): { attrs: Partial<{}>; slots: { default?(_: {}): any; }; refs: {}; rootEl: HTMLFormElement; }; type __VLS_TemplateResult = ReturnType; declare const __VLS_component: import('vue').DefineComponent) => any; finish: () => any; finishFailed: (errors: unknown) => any; }, string, import('vue').PublicProps, Readonly & Readonly<{ onSubmit?: ((model: Record) => any) | undefined; onFinish?: (() => any) | undefined; onFinishFailed?: ((errors: unknown) => any) | undefined; }>, { name: string; colon: boolean; hideRequiredMark: boolean; labelAlign: "left" | "center" | "right" | "end"; validateTrigger: ValidTrigger; showLabel: boolean; }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLFormElement>; declare const _default: __VLS_WithTemplateSlots; export default _default; type __VLS_WithTemplateSlots = T & { new (): { $slots: S; }; };