mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
update changelog for getFieldDecorator
This commit is contained in:
parent
2875d024f9
commit
ce894a60ae
@ -61,14 +61,16 @@ There are some breaking changes in `antd@2.0.0`, and you need to modify your cod
|
||||
The following change will throw some warnings in the console and it will still work, but we recommend to update your code.
|
||||
|
||||
* `getFieldProps` of Form is deprecated, please use `getFieldDecorator`:
|
||||
|
||||
```diff
|
||||
+ getFieldDecorator('userName', { ... })(
|
||||
<Input placeholder="请输入账户名"
|
||||
- {...getFieldProps('userName', { ... })}
|
||||
/>
|
||||
+ )
|
||||
- <Input placeholder="text" {...getFieldProps('userName', { ... })} />
|
||||
+ {getFieldDecorator('userName', { ... })(
|
||||
+ <Input placeholder="text" />
|
||||
+ )}
|
||||
```
|
||||
|
||||
* `toggleOpen` of DatePicker is deprecated, please use `onOpenChange`:
|
||||
|
||||
```diff
|
||||
- handleToggleOpen({ open }) {
|
||||
+ handleOpenChange(open) {
|
||||
|
@ -59,14 +59,16 @@ timeline: true
|
||||
以下变化升级后旧代码仍然能正常运行,但是控制台会出现警告提示,建议按提示进行修改。
|
||||
|
||||
* Form 废弃 `getFieldProps`,请使用 `getFieldDecorator`:
|
||||
|
||||
```diff
|
||||
+ getFieldDecorator('userName', { ... })(
|
||||
<Input placeholder="请输入账户名"
|
||||
- {...getFieldProps('userName', { ... })}
|
||||
/>
|
||||
+ )
|
||||
- <Input placeholder="text" {...getFieldProps('userName', { ... })} />
|
||||
+ {getFieldDecorator('userName', { ... })(
|
||||
+ <Input placeholder="text" />
|
||||
+ )}
|
||||
```
|
||||
|
||||
* DatePicker 废弃 `toggleOpen`,请使用 `onOpenChange`:
|
||||
|
||||
```diff
|
||||
- handleToggleOpen({ open }) {
|
||||
+ handleOpenChange(open) {
|
||||
|
Loading…
Reference in New Issue
Block a user