This commit is contained in:
liushaozhen 2020-07-01 15:18:20 +08:00
parent c4178de729
commit 6c16ddc8b6
3 changed files with 9 additions and 1 deletions

View File

@ -99,6 +99,10 @@ function bigData(Table) {
_this.cachedRowHeight = []; //缓存每行的高度 _this.cachedRowHeight = []; //缓存每行的高度
_this.cachedRowParentIndex = []; _this.cachedRowParentIndex = [];
_this.computeCachedRowParentIndex(newData); _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) { if (newData.length && newData[0].key == undefined) {
//数据没有key时设置key //数据没有key时设置key

View File

@ -1,6 +1,6 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "2.2.30-nc.7", "version": "2.2.30-nc.8",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",

View File

@ -72,6 +72,10 @@ export default function bigData(Table) {
_this.cachedRowHeight = []; //缓存每行的高度 _this.cachedRowHeight = []; //缓存每行的高度
_this.cachedRowParentIndex = []; _this.cachedRowParentIndex = [];
_this.computeCachedRowParentIndex(newData); _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 if(newData.length&&(newData[0].key==undefined)){//数据没有key时设置key
_this.cachedRowParentIndex = []; _this.cachedRowParentIndex = [];