当前位置:网站首页>Antd Design Form表单检验
Antd Design Form表单检验
2022-04-23 06:05:00 【念雅】
第一种常规用法
<Form.Item
name={dataIndex}
style={
{
margin: 0,
}}
rules={[
{
required: must,
message: ` ${title}不能为空!`,
},
]}
>
{inputNode}
</Form.Item>
第二种 根据需要添加规则
rules校验规则
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
enum | 枚举类型 | string | - |
len | 字段长度 | number | - |
max | 最大长度 | number | - |
message | 校验文案 | string | ReactNode |
min | 最小长度 | number | - |
pattern | 正则表达式校验 | RegExp | - |
required | 是否必选 | boolean | false |
transform | 校验前转换字段值 | function(value) => transformedValue:any | - |
type | 内建校验类型,可选项 | string | ‘string’ |
validator | 自定义校验(注意,callback 必须被调用) | function(rule, value, callback) | - |
whitespace | 必选时,空格是否会被视为错误 | boolean | false |
版权声明
本文为[念雅]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_43865681/article/details/120036019
边栏推荐
- Dolphinscheduler集成Flink任务踩坑记录
- Oracle和mysql批量查询用户下所有表名和表名注释
- Using Prom label proxy to implement label based multi tenant reading of Prometheus thanos
- ACFS文件系统创建扩大缩小等配置步骤
- Exception record-14
- try catch 不能捕获异步错误
- 19C RAC修改VIP及SCANIP步骤-同网段
- 异常记录-13
- Dolphinscheduler配置Datax踩坑记录
- Build an OSS based image sharing website - polite feedback
猜你喜欢
Dolphinscheduler调度sql任务建表时The query did not generate a result set异常解决
Apache Atlas 编译及安装记录
Practice using polardb and ECs to build portal websites
Prometheus Cortex使用Block存储时的相关问题
Dolphinscheduler配置Datax踩坑记录
Thanos Compactor组件使用
PG SQL截取字符串到指定字符位置
实践使用PolarDB和ECS搭建门户网站
Dolphinscheduler调度spark任务踩坑记录
ACFS文件系统创建扩大缩小等配置步骤
随机推荐
Comparison between Prometheus thanos and cortex components
Abnormal record-15
mysql和pg库遇到冲突数据时的两种处理方式
Ali vector library Icon tutorial (online, download)
Abnormal record-21
Prometheus monitoring method and index interpretation of influxdb
Abnormal record-17
基于ECS搭建云上博客(云小宝码上送祝福,免费抽iphone13任务详解)
Alertmanager重复/缺失告警现象探究及两个关键参数group_wait和group_interval的释义
pg库对姓名进行校验
19C环境ORA-01035登陆报错处理
Prometheus Thanos快速指南
JS function package foreach use return can not jump out of the outer function
oracle清除sql的缓存
Exception record-6
异常记录-19
Prometheus Cortex使用Block存储时的相关问题
How does thanos configure different data retention durations for different tenants
异常记录-20
When switch case, concatenate the error case and if of the conventional judgment expression and use L