From a4b69a642365e690148821415d32c32d8d431706 Mon Sep 17 00:00:00 2001 From: kvkens Date: Wed, 24 Oct 2018 20:00:27 +0800 Subject: [PATCH] =?UTF-8?q?update:=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/Table.js | 8 +++----- src/Table.js | 8 ++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/build/Table.js b/build/Table.js index 4ec0174..1f9b49a 100644 --- a/build/Table.js +++ b/build/Table.js @@ -304,7 +304,7 @@ var Table = function (_Component) { e.preventDefault(); e.stopPropagation(); } - var info = this.findExpandedRow(record, index); + var info = this.findExpandedRow(record); if (typeof info !== 'undefined' && !expanded) { this.onRowDestroy(record, index); } else if (!info && expanded) { @@ -920,10 +920,8 @@ var Table = function (_Component) { Table.prototype.findExpandedRow = function findExpandedRow(record, index) { var _this4 = this; - //const rows = this.getExpandedRows().filter(i => i === this.getRowKey(record, index)); - //修复rowKey index问题 By Kvkens 2018-10-24 13:38:38 - var rows = this.getExpandedRows().filter(function (item, i) { - return i === _this4.getRowKey(record, index) || item === _this4.getRowKey(record, index); + var rows = this.getExpandedRows().filter(function (i) { + return i === _this4.getRowKey(record, index); }); return rows[0]; }; diff --git a/src/Table.js b/src/Table.js index d04f5f5..17d42b8 100644 --- a/src/Table.js +++ b/src/Table.js @@ -228,7 +228,7 @@ class Table extends Component { e.preventDefault(); e.stopPropagation(); } - const info = this.findExpandedRow(record, index); + const info = this.findExpandedRow(record); if (typeof info !== 'undefined' && !expanded) { this.onRowDestroy(record, index); } else if (!info && expanded) { @@ -803,11 +803,7 @@ class Table extends Component { } findExpandedRow(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) - }); + const rows = this.getExpandedRows().filter(i => i === this.getRowKey(record, index)); return rows[0]; }