本文共 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/