Update ValidationRule message type (#3163)
parent
d552a41e96
commit
388ed15e82
|
@ -23,7 +23,7 @@ export const FormProps = {
|
||||||
|
|
||||||
export const ValidationRule = {
|
export const ValidationRule = {
|
||||||
/** validation error message */
|
/** validation error message */
|
||||||
message: PropTypes.string,
|
message: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
||||||
/** built-in validation type, available options: https://github.com/yiminghe/async-validator#type */
|
/** built-in validation type, available options: https://github.com/yiminghe/async-validator#type */
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
/** indicates whether field is required */
|
/** indicates whether field is required */
|
||||||
|
|
|
@ -75,7 +75,7 @@ export const FormProps = {
|
||||||
|
|
||||||
export const ValidationRule = {
|
export const ValidationRule = {
|
||||||
/** validation error message */
|
/** validation error message */
|
||||||
message: PropTypes.string,
|
message: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
||||||
/** built-in validation type, available options: https://github.com/yiminghe/async-validator#type */
|
/** built-in validation type, available options: https://github.com/yiminghe/async-validator#type */
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
/** indicates whether field is required */
|
/** indicates whether field is required */
|
||||||
|
|
|
@ -11,9 +11,9 @@ declare interface ValidationRule {
|
||||||
trigger?: string;
|
trigger?: string;
|
||||||
/**
|
/**
|
||||||
* validation error message
|
* validation error message
|
||||||
* @type string
|
* @type string | Function
|
||||||
*/
|
*/
|
||||||
message?: string;
|
message?: string | (() => string)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* built-in validation type, available options: https://github.com/yiminghe/async-validator#type
|
* built-in validation type, available options: https://github.com/yiminghe/async-validator#type
|
||||||
|
|
|
@ -51,9 +51,9 @@ export type ValidateFieldsOptions = {
|
||||||
declare interface ValidationRule {
|
declare interface ValidationRule {
|
||||||
/**
|
/**
|
||||||
* validation error message
|
* validation error message
|
||||||
* @type string
|
* @type string | Function
|
||||||
*/
|
*/
|
||||||
message?: string;
|
message?: string | (() => string)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* built-in validation type, available options: https://github.com/yiminghe/async-validator#type
|
* built-in validation type, available options: https://github.com/yiminghe/async-validator#type
|
||||||
|
|
Loading…
Reference in New Issue