diff --git a/build/lib/bigData.js b/build/lib/bigData.js index c0a7e0c..74d78a8 100644 --- a/build/lib/bigData.js +++ b/build/lib/bigData.js @@ -99,6 +99,10 @@ function bigData(Table) { _this.cachedRowHeight = []; //缓存每行的高度 _this.cachedRowParentIndex = []; _this.computeCachedRowParentIndex(newData); + // fix:切换数据源,startIndex、endIndex错误 + _this.currentIndex = 0; + _this.startIndex = _this.currentIndex; //数据开始位置 + _this.endIndex = _this.currentIndex + _this.loadCount; } if (newData.length && newData[0].key == undefined) { //数据没有key时设置key diff --git a/package.json b/package.json index 231e8d2..6778239 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-table", - "version": "2.2.30-nc.7", + "version": "2.2.30-nc.8", "description": "Table ui component for react", "keywords": [ "react", diff --git a/src/lib/bigData.js b/src/lib/bigData.js index dbb37e8..cc6e19c 100644 --- a/src/lib/bigData.js +++ b/src/lib/bigData.js @@ -72,6 +72,10 @@ export default function bigData(Table) { _this.cachedRowHeight = []; //缓存每行的高度 _this.cachedRowParentIndex = []; _this.computeCachedRowParentIndex(newData); + // fix:切换数据源,startIndex、endIndex错误 + _this.currentIndex = 0; + _this.startIndex = _this.currentIndex; //数据开始位置 + _this.endIndex = _this.currentIndex + _this.loadCount; } if(newData.length&&(newData[0].key==undefined)){//数据没有key时设置key _this.cachedRowParentIndex = [];