mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-03 04:27:41 +08:00
feat: update table
This commit is contained in:
parent
213706c185
commit
d50fad7f6d
@ -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'
|
||||
|
@ -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,
|
||||
|
@ -201,7 +201,7 @@ const ExpandableTable = {
|
||||
}
|
||||
|
||||
if (childrenData) {
|
||||
renderRows(childrenData, nextIndent, rows, nextAncestorKeys)
|
||||
rows.push(...renderRows(childrenData, nextIndent, nextAncestorKeys))
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
// based on rc-tree 1.12.6
|
||||
// based on rc-tree 1.14.6
|
||||
'use strict'
|
||||
|
||||
module.exports = require('./src/')
|
||||
|
Loading…
Reference in New Issue
Block a user