update:还原

This commit is contained in:
kvkens 2018-10-24 20:00:27 +08:00
parent 0711316683
commit a4b69a6423
2 changed files with 5 additions and 11 deletions

View File

@ -304,7 +304,7 @@ var Table = function (_Component) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
} }
var info = this.findExpandedRow(record, index); var info = this.findExpandedRow(record);
if (typeof info !== 'undefined' && !expanded) { if (typeof info !== 'undefined' && !expanded) {
this.onRowDestroy(record, index); this.onRowDestroy(record, index);
} else if (!info && expanded) { } else if (!info && expanded) {
@ -920,10 +920,8 @@ var Table = function (_Component) {
Table.prototype.findExpandedRow = function findExpandedRow(record, index) { Table.prototype.findExpandedRow = function findExpandedRow(record, index) {
var _this4 = this; var _this4 = this;
//const rows = this.getExpandedRows().filter(i => i === this.getRowKey(record, index)); var rows = this.getExpandedRows().filter(function (i) {
//修复rowKey index问题 By Kvkens 2018-10-24 13:38:38 return i === _this4.getRowKey(record, index);
var rows = this.getExpandedRows().filter(function (item, i) {
return i === _this4.getRowKey(record, index) || item === _this4.getRowKey(record, index);
}); });
return rows[0]; return rows[0];
}; };

View File

@ -228,7 +228,7 @@ class Table extends Component {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
} }
const info = this.findExpandedRow(record, index); const info = this.findExpandedRow(record);
if (typeof info !== 'undefined' && !expanded) { if (typeof info !== 'undefined' && !expanded) {
this.onRowDestroy(record, index); this.onRowDestroy(record, index);
} else if (!info && expanded) { } else if (!info && expanded) {
@ -803,11 +803,7 @@ class Table extends Component {
} }
findExpandedRow(record, index) { findExpandedRow(record, index) {
//const rows = this.getExpandedRows().filter(i => i === this.getRowKey(record, index)); const rows = this.getExpandedRows().filter(i => i === this.getRowKey(record, index));
//修复rowKey index问题 By Kvkens 2018-10-24 13:38:38
const rows = this.getExpandedRows().filter((item, i) => {
return i === this.getRowKey(record, index) || item === this.getRowKey(record, index)
});
return rows[0]; return rows[0];
} }