Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
6ed30ada
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6ed30ada
编写于
12月 04, 2017
作者:
W
Wei Zhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
site: indent code block
上级
6836487e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
98 addition
and
98 deletion
+98
-98
CHANGELOG.en-US.md
CHANGELOG.en-US.md
+45
-45
CHANGELOG.zh-CN.md
CHANGELOG.zh-CN.md
+53
-53
未找到文件。
CHANGELOG.en-US.md
浏览文件 @
6ed30ada
...
...
@@ -38,30 +38,30 @@ timeline: true
-
Form
`getFieldDecorator`
's
`exclusive`
option has been removeed.
-
Added
`Form.createFormField`
, and you must use it to wrap field data returned in
`option.mapPropsToFields`
:
```
diff
import { Form } from 'antd';
Form.create({
mapPropsToFields() {
return {
- name: { value: 'antd' },
+ name: Form.createFormField({ value: 'antd' }),
};
},
})
```
```
diff
import { Form } from 'antd';
Form.create({
mapPropsToFields() {
return {
- name: { value: 'antd' },
+ name: Form.createFormField({ value: 'antd' }),
};
},
})
```
-
Improved global reset style, if you encounter style problem after upgrading, you can try import our v2 compatible style.
```
javascript
import
'
antd/style/v2-compatible-reset
'
;
```
```
javascript
import
'
antd/style/v2-compatible-reset
'
;
```
Or use less
Or use less
```
less
@import '~antd/style/v2-compatible-reset.css';
```
```
less
@import '~antd/style/v2-compatible-reset.css';
```
-
Since we changed default locale to en_US, LocalProvider is not required any more for English users.
-
We don't set
`size="large"`
to
`Input`
in
`Form`
by default any more.
...
...
@@ -109,24 +109,24 @@ Or use less
-
🌟 Added new
`focusOnOpen`
prop to focus input after panel is open.
-
Table
-
🌟 Added new
`components`
prop to allow overriding default table elements.
```
javascript
// You can override following elements
const
components
=
{
table
:
MyTable
,
header
:
{
wrapper
:
HeaderWrapper
,
row
:
HeaderRow
,
cell
:
HeaderCell
,
},
body
:
{
wrapper
:
BodyWrapper
,
row
:
BodyRow
,
cell
:
BodyCell
,
},
};
```
javascript
// You can override following elements
const
components
=
{
table
:
MyTable
,
header
:
{
wrapper
:
HeaderWrapper
,
row
:
HeaderRow
,
cell
:
HeaderCell
,
},
body
:
{
wrapper
:
BodyWrapper
,
row
:
BodyRow
,
cell
:
BodyCell
,
},
};
<
Table
components
=
{
components
}
columns
=
{
columns
data
=
{
data
}}
/>
```
<
Table
components
=
{
components
}
columns
=
{
columns
data
=
{
data
}}
/>
```
-
🌟 Added new
`onRow`
prop to allow passing custom props to table body row.
-
🌟 Added new
`onHeaderRow`
props to allow passing custom props to table header row.
-
🌟 Added
`column[onCell]`
to allow passing custom props to table body cell.
...
...
@@ -136,15 +136,15 @@ Or use less
-
🌟 Added
`rowSelection[fixed]`
to allow fixing the selection column.。
-
🙅 Deprecated
`getBodyWrapper`
, please use
`components`
instead.
-
🙅 Deprecated
`onRowClick`
,
`onRowDoubleClick`
、
`onRowContextMenu`
、
`onRowMouseEnter`
、
`onRowMouseLeave`
, please use
`onRow`
instead.
```
javascript
<
Table
onRow
=
{(
record
)
=>
({
onClick
:
()
=>
{},
onDoubleClick
:
()
=>
{},
onContextMenu
:
()
=>
{},
onMouseEnter
:
()
=>
{},
onMouseLeave
:
()
=>
{},
})}
/>
```
```
javascript
<
Table
onRow
=
{(
record
)
=>
({
onClick
:
()
=>
{},
onDoubleClick
:
()
=>
{},
onContextMenu
:
()
=>
{},
onMouseEnter
:
()
=>
{},
onMouseLeave
:
()
=>
{},
})}
/>
```
-
Select
-
🌟 Option's value can be a number in single or multiple mode.
-
🌟 Added new
`maxTagCount`
and
`maxTagPlaceholder`
props.
...
...
CHANGELOG.zh-CN.md
浏览文件 @
6ed30ada
...
...
@@ -38,42 +38,42 @@ timeline: true
-
Form
`getFieldDecorator`
的
`exclusive`
参数被移除,此类场景应该由 Radio.Group、Checkbox.Group 之类的组件来完成。
-
新增
`Form.createFormField`
方法,
`mapPropsToFields`
返回的字段都需要由该方法创建。
```
diff
import { Form } from 'antd';
Form.create({
mapPropsToFields() {
return {
- name: { value: 'antd' },
+ name: Form.createFormField({ value: 'antd' }),
};
},
})
```
```
diff
import { Form } from 'antd';
Form.create({
mapPropsToFields() {
return {
- name: { value: 'antd' },
+ name: Form.createFormField({ value: 'antd' }),
};
},
})
```
-
优化了全局的重置样式,如果升级后你的全局样式有问题,可以引入我们提供的 2.x 兼容样式。
```
javascript
import
'
antd/style/v2-compatible-reset
'
;
```
```
javascript
import
'
antd/style/v2-compatible-reset
'
;
```
或者在 less 里引入
或者在 less 里引入
```
less
@import '~antd/style/v2-compatible-reset.css';
```
```
less
@import '~antd/style/v2-compatible-reset.css';
```
-
由于默认语言改为英文,如果你需要显示中文,现在需要配置
`LocalProvider`
。
```
javascript
import
{
LocaleProvider
}
from
'
antd
'
;
import
zhCN
from
'
antd/lib/locale-provider/zh_CN
'
;
```
javascript
import
{
LocaleProvider
}
from
'
antd
'
;
import
zhCN
from
'
antd/lib/locale-provider/zh_CN
'
;
ReactDOM
.
render
(
<
LocaleProvider
locale
=
{
zhCN
}
><
YourApp
/><
/LocaleProvider>
,
document
.
getElementById
(
'
root
'
)
);
```
ReactDOM
.
render
(
<
LocaleProvider
locale
=
{
zhCN
}
><
YourApp
/><
/LocaleProvider>
,
document
.
getElementById
(
'
root
'
)
);
```
-
Form 下的表单控件不再默认为 size="large"。
...
...
@@ -120,24 +120,24 @@ ReactDOM.render(
-
🌟 新增
`focusOnOpen`
,用于设置在打开面板的时候是否聚焦输入框。
-
Table
-
🌟 新增
`components`
属性,用于覆盖表格元素的默认标签。
```
javascript
// 支持覆盖的元素
const
components
=
{
table
:
MyTable
,
header
:
{
wrapper
:
HeaderWrapper
,
row
:
HeaderRow
,
cell
:
HeaderCell
,
},
body
:
{
wrapper
:
BodyWrapper
,
row
:
BodyRow
,
cell
:
BodyCell
,
},
};
```
javascript
// 支持覆盖的元素
const
components
=
{
table
:
MyTable
,
header
:
{
wrapper
:
HeaderWrapper
,
row
:
HeaderRow
,
cell
:
HeaderCell
,
},
body
:
{
wrapper
:
BodyWrapper
,
row
:
BodyRow
,
cell
:
BodyCell
,
},
};
<
Table
components
=
{
components
}
columns
=
{
columns
data
=
{
data
}}
/>
```
<
Table
components
=
{
components
}
columns
=
{
columns
data
=
{
data
}}
/>
```
-
🌟 新增
`onRow`
属性,用于设置表格列的属性。
-
🌟 新增
`onHeaderRow`
,用户设置表格头部列的属性。
-
🌟 新增
`column[onCell]`
,用户设置单元格的属性。
...
...
@@ -147,15 +147,15 @@ ReactDOM.render(
-
🌟 新增
`rowSelection[fixed]`
,用于固定选择列。
-
🙅 废弃
`getBodyWrapper`
,请使用
`components`
属性代替。
-
🙅 废弃以下属性
`onRowClick`
,
`onRowDoubleClick`
、
`onRowContextMenu`
、
`onRowMouseEnter`
、
`onRowMouseLeave`
,请使用
`onRow`
代替。
```
javascript
<
Table
onRow
=
{(
record
)
=>
({
onClick
:
()
=>
{},
onDoubleClick
:
()
=>
{},
onContextMenu
:
()
=>
{},
onMouseEnter
:
()
=>
{},
onMouseLeave
:
()
=>
{},
})}
/>
```
```
javascript
<
Table
onRow
=
{(
record
)
=>
({
onClick
:
()
=>
{},
onDoubleClick
:
()
=>
{},
onContextMenu
:
()
=>
{},
onMouseEnter
:
()
=>
{},
onMouseLeave
:
()
=>
{},
})}
/>
```
-
Select
-
🌟 默认和多选模式下 Option 的值允许使用 number。
-
🌟 新增
`maxTagCount 和 `
maxTagPlaceholder
`,用与设置最多可显示的选中项。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录