简体中文
外观
Home > ValidationRule
校验规则(声明式,纯数据,可序列化)
interface ValidationRule
属性名
修饰符
类型
描述
max?
number
(可选) 最大值(数字)
maxLength?
(可选) 最大长度(字符串)
message?
string
(可选) 校验失败时的提示文案
min?
(可选) 最小值(数字)
minLength?
(可选) 最小长度(字符串)
pattern?
(可选) 正则表达式字符串(匹配失败即校验失败)
required?
boolean
(可选) 是否必填(空值 = null/undefined/空白字符串)