fix: 表格key警告问题

This commit is contained in:
izbz wh 2019-03-19 19:37:59 +08:00
parent 74dbebeba7
commit 6977e2f27d
7 changed files with 4562 additions and 4570 deletions

View File

@ -15,6 +15,7 @@ const columns = [
title:'序号',
dataIndex:'index',
width:'50',
key:'index',
render:(text,record,index)=>{
return index
}

View File

@ -19,6 +19,7 @@ const columns = [
title:'序号',
dataIndex:'index',
width:'50',
key:'index',
render:(text,record,index)=>{
return index
}

View File

@ -16,6 +16,7 @@ const columns = [
title:'序号',
dataIndex:'index',
width:'150',
key:'index',
render:(text,record,index)=>{
return index
}

File diff suppressed because one or more lines are too long

9110
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -548,7 +548,7 @@ class Table extends Component {
const expandIconColumnIndex = fixed !== 'right' ? props.expandIconColumnIndex : -1;
if(props.lazyLoad && props.lazyLoad.preHeight && indent == 0){
rst.push(
<TableRow height={props.lazyLoad.preHeight} columns={[]} className='' store={this.store} visible = {true}/>
<TableRow height={props.lazyLoad.preHeight} columns={[]} className='' key={'table_row_first'} store={this.store} visible = {true}/>
)
}
const lazyCurrentIndex = props.lazyLoad && props.lazyLoad.startIndex ?props.lazyLoad.startIndex :0;
@ -669,7 +669,7 @@ class Table extends Component {
if(props.lazyLoad && props.lazyLoad.sufHeight && indent == 0){
rst.push(
<TableRow height={props.lazyLoad.sufHeight} columns={[]} className='' store={this.store} visible = {true}/>
<TableRow height={props.lazyLoad.sufHeight} key={'table_row_end'} columns={[]} className='' store={this.store} visible = {true}/>
)
}
return rst;
@ -678,7 +678,8 @@ class Table extends Component {
getRows(columns, fixed) {
//统计index只有含有鼠表结构才有用因为数表结构时固定列的索引取值有问题
this.treeRowIndex = 0;
return this.getRowsByData(this.state.data, true, 0, columns, fixed);
let rs = this.getRowsByData(this.state.data, true, 0, columns, fixed);
return rs;
}
getColGroup(columns, fixed) {