mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
docs: correct inline to noStyle (#22029)
This commit is contained in:
parent
28c06266d0
commit
6d48c131dc
@ -112,7 +112,7 @@ class Demo extends React.Component {
|
||||
}
|
||||
```
|
||||
|
||||
If you don't want to use the Item style, you can use `inline` prop to remove it:
|
||||
If you don't want to use the Item style, you can use `noStyle` prop to remove it:
|
||||
|
||||
```jsx
|
||||
// antd v3
|
||||
@ -269,19 +269,14 @@ Nested field definition has changed from:
|
||||
|
||||
```jsx
|
||||
// antd v3
|
||||
<Form.Item label="Firstname">
|
||||
{getFieldDecorator("user.0.firstname", {})(<Input />)}
|
||||
</Form.Item>
|
||||
<Form.Item label="Firstname">{getFieldDecorator('user.0.firstname', {})(<Input />)}</Form.Item>
|
||||
```
|
||||
|
||||
To
|
||||
To
|
||||
|
||||
```jsx
|
||||
// antd v4
|
||||
<Form.Item
|
||||
name={['user', '0', 'firstname']}
|
||||
label="Firstname"
|
||||
>
|
||||
<Form.Item name={['user', '0', 'firstname']} label="Firstname">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
```
|
||||
@ -291,7 +286,7 @@ Similarly using `setFieldsValue` has changed from:
|
||||
```jsx
|
||||
// antd v3
|
||||
this.formRef.current.setFieldsValue({
|
||||
'user.0.firstname': 'John'
|
||||
'user.0.firstname': 'John',
|
||||
});
|
||||
```
|
||||
|
||||
@ -300,14 +295,14 @@ To
|
||||
```jsx
|
||||
// antd v4
|
||||
this.formRef.current.setFieldsValue({
|
||||
user:
|
||||
[{
|
||||
firstname: 'John'
|
||||
}]
|
||||
user: [
|
||||
{
|
||||
firstname: 'John',
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
### Remove callback in validateFields
|
||||
|
||||
`validateFields` will return a Promise, so you can handle the error with `async/await` or `then/catch`. It is no longer necessary to determine if `errors` is empty:
|
||||
|
@ -114,7 +114,7 @@ class Demo extends React.Component {
|
||||
}
|
||||
```
|
||||
|
||||
由于 Form.Item 内置字段绑定,如果需要不带样式的表单绑定,可以使用 `inline` 属性移除额外样式:
|
||||
由于 Form.Item 内置字段绑定,如果需要不带样式的表单绑定,可以使用 `noStyle` 属性移除额外样式:
|
||||
|
||||
```jsx
|
||||
// antd v3
|
||||
@ -267,24 +267,18 @@ form.getFieldsError();
|
||||
*/
|
||||
```
|
||||
|
||||
|
||||
嵌套字段定义由:
|
||||
|
||||
```jsx
|
||||
// antd v3
|
||||
<Form.Item label="Firstname">
|
||||
{getFieldDecorator("user.0.firstname", {})(<Input />)}
|
||||
</Form.Item>
|
||||
<Form.Item label="Firstname">{getFieldDecorator('user.0.firstname', {})(<Input />)}</Form.Item>
|
||||
```
|
||||
|
||||
改至:
|
||||
|
||||
```jsx
|
||||
// antd v4
|
||||
<Form.Item
|
||||
name={['user', '0', 'firstname']}
|
||||
label="Firstname"
|
||||
>
|
||||
<Form.Item name={['user', '0', 'firstname']} label="Firstname">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
```
|
||||
@ -294,7 +288,7 @@ form.getFieldsError();
|
||||
```jsx
|
||||
// antd v3
|
||||
this.formRef.current.setFieldsValue({
|
||||
'user.0.firstname': 'John'
|
||||
'user.0.firstname': 'John',
|
||||
});
|
||||
```
|
||||
|
||||
@ -303,10 +297,11 @@ this.formRef.current.setFieldsValue({
|
||||
```jsx
|
||||
// antd v4
|
||||
this.formRef.current.setFieldsValue({
|
||||
user:
|
||||
[{
|
||||
firstname: 'John'
|
||||
}]
|
||||
user: [
|
||||
{
|
||||
firstname: 'John',
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user