博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ant design中的Form.List 如何支持dependencies
阅读量:4096 次
发布时间:2019-05-25

本文共 1198 字,大约阅读时间需要 3 分钟。

1、单个

官网例子:

需要注意区分shouldUpdate

2、多个Form.List

{
( fields, {
add, remove } ) => ( <> {
fields.map( ( field ) => (
( {
validator( _, value ) {
console.log( "name" ); if ( !value || getFieldValue( "users" )[field.fieldKey].name.length < value.length ) {
return Promise.resolve(); } return Promise.reject( "the length of the name is less than the length of the age" ); } } ) ] } >
remove( field.name ) }/>
) ) }
) }
  • 解释:

dependencies={[["users", 0, "name"]]}

users:Form.List的name
0:第几行
name:依赖的参数

参考链接:

链接1、
链接2、

转载地址:http://vdqii.baihongyu.com/

你可能感兴趣的文章
zookeeper(3)---zookeeper API的简单使用(增删改查操作)
查看>>
zookeeper(4)---监听器Watcher
查看>>
mapReduce(3)---入门示例WordCount
查看>>
hbase(3)---shell操作
查看>>
hbase(1)---概述
查看>>
hbase(5)---API示例
查看>>
SSM-CRUD(1)---环境搭建
查看>>
SSM-CRUD(2)---查询
查看>>
SSM-CRUD (3)---查询功能改造
查看>>
Nginx(2)---安装与启动
查看>>
springBoot(5)---整合servlet、Filter、Listener
查看>>
C++ 模板类型参数
查看>>
C++ 非类型模版参数
查看>>
设计模式 依赖倒转原则 & 里氏代换原则
查看>>
DirectX11 光照
查看>>
图形学 图形渲染管线
查看>>
DirectX11 计时和动画
查看>>
DirectX11 光照与材质的相互作用
查看>>
DirectX11 环境光
查看>>
DirectX11 镜面光
查看>>