mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 22:39:34 +08:00
docs: update form escape (#50412)
This commit is contained in:
parent
aa60e53d4c
commit
3b9a1b1123
@ -139,7 +139,7 @@ Form field component for data bidirectional binding, validation, layout, and so
|
||||
| label | Label text | ReactNode | - | |
|
||||
| labelAlign | The text align of label | `left` \| `right` | `right` | |
|
||||
| labelCol | The layout of label. You can set `span` `offset` to something like `{span: 3, offset: 12}` or `sm: {span: 3, offset: 12}` same as with `<Col>`. You can set `labelCol` on Form which will not affect nest Item. If both exists, use Item first | [object](/components/grid/#col) | - | |
|
||||
| messageVariables | The default validate field info | Record<string, string> | - | 4.7.0 |
|
||||
| messageVariables | The default validate field info, description [see below](#messagevariables) | Record<string, string> | - | 4.7.0 |
|
||||
| name | Field name, support array | [NamePath](#namepath) | - | |
|
||||
| normalize | Normalize value from component value before passing to Form instance. Do not support async | (value, prevValue, prevValues) => any | - | |
|
||||
| noStyle | No style for `true`, used as a pure field control. Will inherit parent Form.Item `validateStatus` if self `validateStatus` not configured | boolean | false | |
|
||||
@ -230,6 +230,14 @@ You can modify the default verification information of Form.Item through `messag
|
||||
</Form>
|
||||
```
|
||||
|
||||
Since `5.20.2`, when you don't want to convert `${}`, you can use `\\${}` to skip:
|
||||
|
||||
```jsx
|
||||
{ required: true, message: '${label} is convert, \\${label} is not convert' }
|
||||
|
||||
// good is convert, ${label} is not convert
|
||||
```
|
||||
|
||||
## Form.List
|
||||
|
||||
Provides array management for fields.
|
||||
|
@ -140,7 +140,7 @@ const validateMessages = {
|
||||
| label | `label` 标签的文本 | ReactNode | - | |
|
||||
| labelAlign | 标签文本对齐方式 | `left` \| `right` | `right` | |
|
||||
| labelCol | `label` 标签布局,同 `<Col>` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}` 或 `sm: {span: 3, offset: 12}`。你可以通过 Form 的 `labelCol` 进行统一设置,不会作用于嵌套 Item。当和 Form 同时设置时,以 Item 为准 | [object](/components/grid-cn#col) | - | |
|
||||
| messageVariables | 默认验证字段的信息 | Record<string, string> | - | 4.7.0 |
|
||||
| messageVariables | 默认验证字段的信息,查看[详情](#messagevariables) | Record<string, string> | - | 4.7.0 |
|
||||
| name | 字段名,支持数组 | [NamePath](#namepath) | - | |
|
||||
| normalize | 组件获取值后进行转换,再放入 Form 中。不支持异步 | (value, prevValue, prevValues) => any | - | |
|
||||
| noStyle | 为 `true` 时不带样式,作为纯字段控件使用。当自身没有 `validateStatus` 而父元素存在有 `validateStatus` 的 Form.Item 会继承父元素的 `validateStatus` | boolean | false | |
|
||||
@ -231,6 +231,14 @@ Form 通过增量更新方式,只更新被修改的字段相关组件以达到
|
||||
</Form>
|
||||
```
|
||||
|
||||
自 `5.20.2` 起,当你希望不要转译 `${}` 时,你可以通过 `\\${}` 来略过:
|
||||
|
||||
```jsx
|
||||
{ required: true, message: '${label} is convert, \\${label} is not convert' }
|
||||
|
||||
// good is convert, ${label} is not convert
|
||||
```
|
||||
|
||||
## Form.List
|
||||
|
||||
为字段提供数组化管理。
|
||||
|
@ -120,7 +120,7 @@
|
||||
"rc-dialog": "~9.5.2",
|
||||
"rc-drawer": "~7.2.0",
|
||||
"rc-dropdown": "~4.2.0",
|
||||
"rc-field-form": "~2.3.0",
|
||||
"rc-field-form": "~2.4.0",
|
||||
"rc-image": "~7.9.0",
|
||||
"rc-input": "~1.6.3",
|
||||
"rc-input-number": "~9.2.0",
|
||||
|
Loading…
Reference in New Issue
Block a user