fix test case

This commit is contained in:
yoyo837 2018-10-15 16:46:55 +08:00 committed by 偏右
parent da143a064f
commit 512e85ec5f
3 changed files with 2 additions and 36 deletions

View File

@ -3192,7 +3192,6 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
>
<td
class=""
rowindex="0"
>
<div
class="editable-cell-value-wrap"
@ -3231,7 +3230,6 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
>
<td
class=""
rowindex="1"
>
<div
class="editable-cell-value-wrap"
@ -3420,7 +3418,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="0"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3430,13 +3427,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="0"
>
32
</td>
<td
class=""
rowindex="0"
>
London Park no. 0
</td>
@ -3456,7 +3451,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="1"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3466,13 +3460,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="1"
>
32
</td>
<td
class=""
rowindex="1"
>
London Park no. 1
</td>
@ -3492,7 +3484,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="2"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3502,13 +3493,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="2"
>
32
</td>
<td
class=""
rowindex="2"
>
London Park no. 2
</td>
@ -3528,7 +3517,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="3"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3538,13 +3526,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="3"
>
32
</td>
<td
class=""
rowindex="3"
>
London Park no. 3
</td>
@ -3564,7 +3550,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="4"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3574,13 +3559,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="4"
>
32
</td>
<td
class=""
rowindex="4"
>
London Park no. 4
</td>
@ -3600,7 +3583,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="5"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3610,13 +3592,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="5"
>
32
</td>
<td
class=""
rowindex="5"
>
London Park no. 5
</td>
@ -3636,7 +3616,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="6"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3646,13 +3625,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="6"
>
32
</td>
<td
class=""
rowindex="6"
>
London Park no. 6
</td>
@ -3672,7 +3649,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="7"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3682,13 +3658,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="7"
>
32
</td>
<td
class=""
rowindex="7"
>
London Park no. 7
</td>
@ -3708,7 +3682,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="8"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3718,13 +3691,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="8"
>
32
</td>
<td
class=""
rowindex="8"
>
London Park no. 8
</td>
@ -3744,7 +3715,6 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
>
<td
class=""
rowindex="9"
>
<span
class="ant-table-row-indent indent-level-0"
@ -3754,13 +3724,11 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
</td>
<td
class=""
rowindex="9"
>
32
</td>
<td
class=""
rowindex="9"
>
London Park no. 9
</td>

View File

@ -211,9 +211,8 @@ class EditableTable extends React.Component {
}
return {
...col,
onCell: (record, rowIndex) => ({
onCell: record => ({
record,
rowIndex,
editable: col.editable,
dataIndex: col.dataIndex,
title: col.title,

View File

@ -186,9 +186,8 @@ class EditableTable extends React.Component {
}
return {
...col,
onCell: (record, rowIndex) => ({
onCell: record => ({
record,
rowIndex,
inputType: col.dataIndex === 'age' ? 'number' : 'text',
dataIndex: col.dataIndex,
title: col.title,