Skip to content

Commit 0620124

Browse files
richardo2016youluna
authored andcommitted
fix(Form): add missing useLabelForErrorMessage definition of props
1 parent 60e0ea4 commit 0620124

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

types/form/index.d.ts

+27-1
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,27 @@ export interface ItemProps extends React.HTMLAttributes<HTMLElement>, CommonProp
201201
* 是否修改数据时自动触发校验
202202
*/
203203
autoValidate?: boolean;
204+
/**
205+
* 在响应式布局下,且label在左边时,label的宽度是多少
206+
*/
204207
labelWidth?: number | string;
208+
/**
209+
* 在响应式布局模式下,表单项占多少列
210+
*/
205211
colSpan?: number;
212+
/**
213+
* 是否开启预览态
214+
*/
206215
isPreview?: boolean;
216+
/**
217+
* 预览态模式下渲染的内容
218+
* @param {any} value 根据包裹的组件的 value 类型而决定
219+
*/
207220
renderPreview?: (values: number | string | data | Array<number | string | data>, props: any) => any
221+
/**
222+
* 是否使用 label 替换校验信息的 name 字段
223+
*/
224+
useLabelForErrorMessage?: boolean
208225
}
209226

210227
export class Item extends React.Component<ItemProps, any> {}
@@ -481,11 +498,20 @@ export interface FormProps extends HTMLAttributesWeak, CommonProps {
481498
* 设置标签类型
482499
*/
483500
component?: string | (() => void);
501+
/**
502+
* 是否开启内置的响应式布局 (使用ResponsiveGrid)
503+
*/
484504
responsive?: boolean;
485505
// 在 responsive模式下,透传给 ResponsiveGrid的, 表示 每个 cell 之间的间距, [bottom&top, right&left]
486506
gap?: number | Array<number>;
507+
/**
508+
* 是否开启预览态
509+
*/
487510
isPreview?: boolean;
488-
renderPreview?: (values: number | string | data | Array<number | string | data>, props: any) => any
511+
/**
512+
* 是否使用 label 替换校验信息的 name 字段
513+
*/
514+
useLabelForErrorMessage?: boolean
489515
}
490516

491517
export default class Form extends React.Component<FormProps, any> {

0 commit comments

Comments
 (0)