From 4331a577ecdc6ef9f0dc1cb1194fe9ef89820ae7 Mon Sep 17 00:00:00 2001 From: ken Date: Mon, 10 Aug 2020 14:01:54 +0800 Subject: [PATCH] =?UTF-8?q?validate=20callback=20=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF=20(#2650)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果返回的是 Boolean 类型,做 if 判断的时候,结果会被认为永远是 true --- types/form-model/form.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/form-model/form.d.ts b/types/form-model/form.d.ts index 6e13e810c..5c1baf922 100644 --- a/types/form-model/form.d.ts +++ b/types/form-model/form.d.ts @@ -153,7 +153,7 @@ export declare class FormModel extends AntdComponent { * and an object containing all fields that fail the validation. Returns a promise if callback is omitted * @type Function */ - validate: (callback?: (boolean: Boolean, object: Object) => void) => void | Promise; + validate: (callback?: (boolean: boolean, object: Object) => void) => void | Promise; /** * validate one or several form items