Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
3738eb3b
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,发现更多精彩内容 >>
提交
3738eb3b
编写于
3月 02, 2016
作者:
A
afc163
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update code style
上级
e8ce54f8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
16 deletion
+8
-16
components/table/demo/expand.md
components/table/demo/expand.md
+2
-10
components/table/index.jsx
components/table/index.jsx
+6
-6
未找到文件。
components/table/demo/expand.md
浏览文件 @
3738eb3b
...
...
@@ -9,19 +9,11 @@
````
jsx
import
{
Table
}
from
'
antd
'
;
function
renderAction
()
{
return
<
a
href
=
"#"
>
删除
</
a
>;
}
function
expandedRowRender
(
record
)
{
return
<
p
>
{
record
.
description
}
</
p
>;
}
const
columns
=
[
{
title
:
'
姓名
'
,
dataIndex
:
'
name
'
,
key
:
'
name
'
},
{
title
:
'
年龄
'
,
dataIndex
:
'
age
'
,
key
:
'
age
'
},
{
title
:
'
住址
'
,
dataIndex
:
'
address
'
,
key
:
'
address
'
},
{
title
:
'
操作
'
,
dataIndex
:
''
,
key
:
'
x
'
,
render
:
renderAction
}
{
title
:
'
操作
'
,
dataIndex
:
''
,
key
:
'
x
'
,
render
:
()
=>
<
a
href
=
"#"
>
删除
</
a
>
}
];
const
data
=
[
...
...
@@ -32,7 +24,7 @@ const data = [
ReactDOM
.
render
(
<
Table
columns
=
{
columns
}
expandedRowRender
=
{
expandedRowRender
}
expandedRowRender
=
{
record
=>
<
p
>
{
record
.
description
}
</
p
>
}
dataSource
=
{
data
}
className
=
"table"
/>
,
mountNode
);
...
...
components/table/index.jsx
浏览文件 @
3738eb3b
...
...
@@ -553,12 +553,12 @@ let AntTable = React.createClass({
},
render
()
{
le
t
data
=
this
.
getCurrentPageData
();
cons
t
data
=
this
.
getCurrentPageData
();
let
columns
=
this
.
renderRowSelection
();
le
t
expandIconAsCell
=
this
.
props
.
expandedRowRender
&&
this
.
props
.
expandIconAsCell
!==
false
;
le
t
locale
=
objectAssign
({},
defaultLocale
,
this
.
props
.
locale
);
cons
t
expandIconAsCell
=
this
.
props
.
expandedRowRender
&&
this
.
props
.
expandIconAsCell
!==
false
;
cons
t
locale
=
objectAssign
({},
defaultLocale
,
this
.
props
.
locale
);
le
t
classString
=
classNames
({
cons
t
classString
=
classNames
({
[
`ant-table-
${
this
.
props
.
size
}
`
]:
true
,
'
ant-table-bordered
'
:
this
.
props
.
bordered
,
[
this
.
props
.
className
]:
!!
this
.
props
.
className
,
...
...
@@ -595,10 +595,10 @@ let AntTable = React.createClass({
if
(
this
.
props
.
loading
)
{
// if there is no pagination or no data,
// the height of spin should decrease by half of pagination
le
t
paginationPatchClass
=
(
this
.
hasPagination
()
&&
data
&&
data
.
length
!==
0
)
cons
t
paginationPatchClass
=
(
this
.
hasPagination
()
&&
data
&&
data
.
length
!==
0
)
?
'
ant-table-with-pagination
'
:
'
ant-table-without-pagination
'
;
le
t
spinClassName
=
`
${
paginationPatchClass
}
ant-table-spin-holder`
;
cons
t
spinClassName
=
`
${
paginationPatchClass
}
ant-table-spin-holder`
;
table
=
<
Spin
className
=
{
spinClassName
}
>
{
table
}
</
Spin
>;
}
return
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录