docs: update form docs description (#44548)

* Update index.zh-CN.md

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* add quotes 

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update index.en-US.md

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update index.en-US.md

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update index.en-US.md

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update components/form/index.zh-CN.md

Co-authored-by: Amumu <yoyo837@hotmail.com>
Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update index.en-US.md

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update index.en-US.md

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update index.en-US.md

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update index.en-US.md

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update index.en-US.md

Signed-off-by: Serene Ding <sereneding123@gmail.com>

* Update components/form/index.zh-CN.md

Signed-off-by: lijianan <574980606@qq.com>

---------

Signed-off-by: Serene Ding <sereneding123@gmail.com>
Signed-off-by: lijianan <574980606@qq.com>
Co-authored-by: Amumu <yoyo837@hotmail.com>
Co-authored-by: lijianan <574980606@qq.com>
This commit is contained in:
Serene Ding 2023-08-31 08:01:51 -07:00 committed by GitHub
parent 48ebf3ab15
commit b0f0975a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -161,7 +161,9 @@ Used when there are dependencies between fields. If a field has the `dependencie
Form updates only the modified field-related components for performance optimization purposes by incremental update. In most cases, you only need to write code or do validation with the [`dependencies`](#dependencies) property. In some specific cases, such as when a new field option appears with a field value changed, or you just want to keep some area updating by form update, you can modify the update logic of Form.Item via the `shouldUpdate`.
When `shouldUpdate` is `true`, any Form update will cause the Form.Item to be re-rendered. This is very helpful for custom rendering some areas:
When `shouldUpdate` is `true`, any Form update will cause the Form.Item to be re-rendered. This is very helpful for custom rendering some areas. It should be noted that the child component should be returned in a function, otherwise `shouldUpdate` won't behave correctly:
related issue: [#34500](https://github.com/ant-design/ant-design/issues/34500)
```jsx
<Form.Item shouldUpdate>

View File

@ -162,7 +162,9 @@ const validateMessages = {
Form 通过增量更新方式,只更新被修改的字段相关组件以达到性能优化目的。大部分场景下,你只需要编写代码或者与 [`dependencies`](#dependencies) 属性配合校验即可。而在某些特定场景,例如修改某个字段值后出现新的字段选项、或者纯粹希望表单任意变化都对某一个区域进行渲染。你可以通过 `shouldUpdate` 修改 Form.Item 的更新逻辑。
`shouldUpdate``true`Form 的任意变化都会使该 Form.Item 重新渲染。这对于自定义渲染一些区域十分有帮助:
`shouldUpdate``true`Form 的任意变化都会使该 Form.Item 重新渲染。这对于自定义渲染一些区域十分有帮助,要注意 Form.Item 里包裹的子组件必须由函数返回,否则 `shouldUpdate` 不会起作用:
相关issue[#34500](https://github.com/ant-design/ant-design/issues/34500)
```jsx
<Form.Item shouldUpdate>