Skip to content

Commit d50fad7

Browse files
committed
feat: update table
1 parent 213706c commit d50fad7

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

components/vc-table/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// base rc-table 6.2.8
1+
// base rc-table 6.2.9
22
import T from './src/Table'
33
import Column from './src/Column'
44
import ColumnGroup from './src/ColumnGroup'

components/vc-table/src/BaseTable.jsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const BaseTable = {
4646
})
4747
},
4848

49-
renderRows (renderData, indent, rows = [], ancestorKeys = []) {
49+
renderRows (renderData, indent, ancestorKeys = []) {
5050
const {
5151
columnManager, sComponents: components,
5252
prefixCls,
@@ -64,6 +64,8 @@ const BaseTable = {
6464
} = this.table
6565
const { getRowKey, fixed, expander, isAnyColumnsFixed } = this
6666

67+
const rows = []
68+
6769
for (let i = 0; i < renderData.length; i++) {
6870
const record = renderData[i]
6971
const key = getRowKey(record, i)
@@ -84,16 +86,12 @@ const BaseTable = {
8486
}
8587

8688
const rowPrefixCls = `${prefixCls}-row`
87-
const rowIndex = rows.filter(row => {
88-
const props = getOptionProps(row)
89-
return !props.expandedRow
90-
}).length
9189

9290
const expandableRowProps = {
9391
props: {
9492
...expander.props,
9593
fixed,
96-
index: rowIndex,
94+
index: i,
9795
prefixCls: rowPrefixCls,
9896
record,
9997
rowKey: key,
@@ -112,7 +110,7 @@ const BaseTable = {
112110
fixed,
113111
indent,
114112
record,
115-
index: rowIndex,
113+
index: i,
116114
prefixCls: rowPrefixCls,
117115
childrenColumnName: childrenColumnName,
118116
columns: leafColumns,

components/vc-table/src/ExpandableTable.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ const ExpandableTable = {
201201
}
202202

203203
if (childrenData) {
204-
renderRows(childrenData, nextIndent, rows, nextAncestorKeys)
204+
rows.push(...renderRows(childrenData, nextIndent, nextAncestorKeys))
205205
}
206206
},
207207
},

components/vc-tree/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// based on rc-tree 1.12.6
1+
// based on rc-tree 1.14.6
22
'use strict'
33

44
module.exports = require('./src/')

0 commit comments

Comments
 (0)