feat: update table

This commit is contained in:
tangjinzhou 2018-09-29 15:08:24 +08:00
parent 213706c185
commit d50fad7f6d
4 changed files with 8 additions and 10 deletions

View File

@ -1,4 +1,4 @@
// base rc-table 6.2.8
// base rc-table 6.2.9
import T from './src/Table'
import Column from './src/Column'
import ColumnGroup from './src/ColumnGroup'

View File

@ -46,7 +46,7 @@ const BaseTable = {
})
},
renderRows (renderData, indent, rows = [], ancestorKeys = []) {
renderRows (renderData, indent, ancestorKeys = []) {
const {
columnManager, sComponents: components,
prefixCls,
@ -64,6 +64,8 @@ const BaseTable = {
} = this.table
const { getRowKey, fixed, expander, isAnyColumnsFixed } = this
const rows = []
for (let i = 0; i < renderData.length; i++) {
const record = renderData[i]
const key = getRowKey(record, i)
@ -84,16 +86,12 @@ const BaseTable = {
}
const rowPrefixCls = `${prefixCls}-row`
const rowIndex = rows.filter(row => {
const props = getOptionProps(row)
return !props.expandedRow
}).length
const expandableRowProps = {
props: {
...expander.props,
fixed,
index: rowIndex,
index: i,
prefixCls: rowPrefixCls,
record,
rowKey: key,
@ -112,7 +110,7 @@ const BaseTable = {
fixed,
indent,
record,
index: rowIndex,
index: i,
prefixCls: rowPrefixCls,
childrenColumnName: childrenColumnName,
columns: leafColumns,

View File

@ -201,7 +201,7 @@ const ExpandableTable = {
}
if (childrenData) {
renderRows(childrenData, nextIndent, rows, nextAncestorKeys)
rows.push(...renderRows(childrenData, nextIndent, nextAncestorKeys))
}
},
},

View File

@ -1,4 +1,4 @@
// based on rc-tree 1.12.6
// based on rc-tree 1.14.6
'use strict'
module.exports = require('./src/')